In CSS (Cascading Style Sheets) you can use both "id" and "class" to select elements to style. For example, you can use:
and use "#test" on your css page to style the text in between the "div" tags. My questions is what is the different between "id" and "class"? Surely I can replace the above "id" with "class", ie.
and use ".test" on your css page and it will provide the same results.
When do you use the "id" and "class" and what is the difference between the two?
Thanks.
<div id="test">Text</div>
and use "#test" on your css page to style the text in between the "div" tags. My questions is what is the different between "id" and "class"? Surely I can replace the above "id" with "class", ie.
<div class="test">Text</div>
and use ".test" on your css page and it will provide the same results.
When do you use the "id" and "class" and what is the difference between the two?
Thanks.

