Your browser (Internet Explorer 6) is out of date. It has known security flaws and may not display all features of this and other websites. Learn how to update your browser.
X

Classes and IDs

The third tutorial video explains the difference between Classes and IDs, but if you do not want to watch it, then read on. We use Classes and IDs in CSS to style our HTML elements.

Think of the two like this. A Class (as in classroom) can be used by many different students at the same time. However, an ID (as in an Identity card) is only meant to be used by one single student.

Therefore, a class can be used by many different HTML elements at the same time, while an ID can only be used by one single HTML element.

We write a Class with a dot ( . ) in front of the name and an ID with a ( # ) in front of the name. For example:



Leave a comment  

name*

email*

website

Submit comment