CSS Layouts: Replacing the Table…

Class and Id

Many individuals become confused to when or not to use classes or ids. Here is the simple rule to the usage of both.

Id

Use id for items that will only appear once within the page. A good rule of thumb is to use id's for structural purposes. Here is how you would apply an id tag to your html.

<div id="namehere">
  &nbsp;
</div>

Class

Use class if you are going to use a CSS specification multiple times throughout one document. For example if you want a specific class to contain a certain font, size, color and text align and you plan on using this multiple times as subheaders then use a class.

<div class="namehere">
  &nbsp;
</div>
Techrangers SM | Last Updated: October 22, 2004