Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

IDs and classes

Featured Replies

Me again, oh many posts from me lmao.

 

After much reading, I took it to mean you could only use one id is a css page but having read a post about someones css probs, I think I got the wrong end of the stick.

 

Am I right in saying that classes you can use for several elements, where as each id can only be used for one?

 

If this is the case, perhaps by adding my toolbar as an id rather than a class I can get rid of my text decoration??

You can see what I am refering to in my latest post on another topic http://www.webdesignerforum.co.uk/index.ph...ost&p=75656.

 

Cheers!

Yes, a class can be used multiple times, whereas an ID is a one-time only thing (eg. header div on a page). You target a ID div in the CSS using # and a class using the . - eg. #header or .comment.

 

As per your question on the thread you linked, you should try wrapping the header in an id, and the nav in it's own div too. Also wrap the entire page in a pagewrap div too. You don't have to, but it makes it easier to centre entire page or move it over to the left if you want etc.

 

<div id="pagewrap">

<div id="header"><h1>My Website</h1></div>

<div id="navigation">
	<ul class="toolbar">
	<li><a href="index.html">Home</a></li>
	<li><a href="meettheteam.html">Meet The Team</a></li>
	etc.
	</ul>

</div>
</div>

 

To change the text decoration of the links you then target links in the navigation (so it can look different from other links if you like)...

 

div#navigation a {
text-decoration: none;
color: #330000;
}

div#navigation a:hover {
text-decoration: underline;
color: #F5CE0A;
}

  • Author

Thanks so much...it worked. Lol now I just need to figure the rest out!!!

:rolleyes:

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.