If you're new here, you may want to subscribe to my RSS feed. Thanks for visiting!
Many users are doing hard confusion when its about using CSS IDs and also about CSS Classes that should be used instead. In the following tutorial we want to show you the differences and to provide some info about CSS IDs.
ID Selector definition:
W3C names ID class as ‘unique identifier to an element’. What really means?If you have read the CSS lesson, we simply say to do so.
CSS IDs are very similar to classe, and they define a special case for a element.
CSS ID example :
HTML code :
Justin case, you have to notice that an IDs CSS is an HTML element, that is followed by a ‘#’ and in the finally ID’s name. The result should be ‘element#idname’. Also pay attention when you are using an ID in HTML to type ‘id=name’ instead of’class = name’ to refer to.
The specific names.
- ID = A person’s Identification (ID) ;
- Class = There are many people in a class.
ID for Layout
ID can be referenced within a page or doc, after Standards. IDs are used correctly in CSS layouts. Why not so, because there is only one menu per page, one banner, and one content pane.
Example :
- Menu - div#menuPane
- Content - div#content
Conclusion
IDs can be used only one ocurence per page. And use classes when there are more occurences.


