|
|
Class vs. Id in CSS - CSS
|
Views : 338
|
|
Tagged in : CSS
|
|
|
Report This Scrap as Inappropriate We request you to choose the appropriate categroy and subcategory that suits your
objectionable concern about the scrap, So that our team can review and find out whether it violates our Guidelines or the
scrap is not suitable for all viewers.
|
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 |
|
|
|