Class vs. Id in CSS - CSS Send mail vote down 0 vote down 0 Views : 282
Tagged in : CSS
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}





By - Rekha, On - 2010-03-30




    Login to add Comments .