Create a Website
HTML
Dreamweaver
CSS Tutorial
JavaScript
FREE Hosting!
With every domain name
you register at DotEasy
you get FREE (no-ad)
one year hosting.
PLUS you get:
  • FREE Website Builder
  • FREE Blog
  • FREE Forum
  • FREE Photo Album
  • FREE Email Accounts
Get your FREE hosting today!
Home > CSS Tutorial
$0 Web Hosting

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)