Hi Kabrenica,
In a very simple way let me put it as "HTML is used to structure content. CSS is used for formatting structured content".
Kindly refer to links below to get a better understanding of what is CSS all about and how CSS can be married to HTML. Happy coding.
http://www.w3schools.com/css/
http://www.html.net/tutorials/css/
Thanks for these great links!
But I was wondering more about the necessity of stating the selector that you plan to use the class with.
For instance, let's say the html is:
<div class="header">Header Text</div>
AND the CSS is:
.header
{
font-size:12px;
color:#333;
}
OR I see it written as:
div.header
{
font-size:12px;
color:#333;
}
Both css declarations work, but which one is more compliant? What's the difference between explicitly stating the selector that is going to use the class declared and not stating it? This is of course assuming that the header class will also be reference with a div tag.
Does that make more sense?