When you use a CLASS (.), you can give an element those properties by including 'class="blah"' inside it's opening tag. more than one element can have the same class.
When you use an ID (#), you can give an element those properties by including 'id="blah"' inside it's opening tag. however, only ONE element per page can have that particular ID...
for example:
- Code: Select all
// CSS CODE //
. red {
color:#ff0000;
}
#green {
color:#00ff00;
}
// HTML CODE //
<h1 class="red">Hello</h1>
<h1 class="red">These are BOTH red</h1>
<h1 id="green">Hello</h1>
<h1 id="green">Only the ONE ABOVE is green</h1>