Class vs. Id in CSS
by Rekha[ Edit ] 2010-03-30 18:31:45
Class vs. Id
Use an Id for elements that are used once and only once on a page
The HTML:
<div id="content"></div>
The CSS:
#content {background: #fff}
Use a class for elements that may be reused on the page
The HTML:
<p class="large-text">
</p>
The CSS:
.large-text {font-size: 1.4em}