id is for unique elements on a page. There should only ever be one of each id on a page.
< d i v id="navigation">< / d i v>
class is for many elements which you want to apply a custom style
< p r e id="prettyprint">Code1< / p r e>
< p r e id="prettyprint">Code2< / p r e>
CSS for id:
div#navigation {background-color: white;}
CSS for class:
div.prettyprint {background-color: white;}
Original Source :
http://www.tizag.com/cssT/cssid.php
No comments:
Post a Comment