Create a Website
HTML
Dreamweaver
CSS Tutorial
JavaScript
FREE Domain!
Any web hosting you subscribe with DotEasy will get you a FREE domain name registration.
PLUS you get:
  • FREE Website Builder
  • FREE Blog
  • FREE Forum
  • FREE Photo Album
  • FREE Email Accounts
Get your FREE domain name today!
Home > CSS Tutorial
SSD Web Hosting with FREE Domain

CSS IDs are similar to classes, except once a specific id has been declared it cannot be used again within the same (X)HTML file.

IDs are generally used to style the layout elements of a page that will only be needed once, ie. header, footer and container.

For example,

The Code

<div id=”container”>
Everything within the page is inside this division.
</div>

Then in the CSS file, we will have the following:

The Code

<div id=”container”>
Everything within the page is inside this division.
</div>

Note, the ID selector begins with a (#) number sign instead of a (.) period, as the class selector does.

Enjoy this tutorial?

1. Link to this page(copy/paste into your own website or blog):
2. Add this page to your favorite social bookmarks sites:
3. Add this page as your favorites. (Press Ctrl+D)