CSS is a way of seperating web page structure from style. Basically, the structure goes in the HTML file and describes things like
Code:
<h1>This is a heading</h1>
<p>This is a paragraph</p>
etc...
That tells the browser nothing about how the page should look. The CSS defines rules that tell the browser how to display these elements, such as:
Code:
h1 {
color: blue;
font-weight: bold;
}
// Tells the browser to make all h1 headings bold & blue
The CSS is usually stored in a seperate file to the HTML but linked to it (although you can define style rules in the head of the document, and even in the HTML tag itself using the style="" attribute - there's advantaged and disadvantages to each, although I wouldn't reccomend putting style info directly into the tag - it defeats the object of CSS!)
Of course it gets more complicated than this, CSS can be used to position elements on the screen and relative to one another, and there are loads of other CSS selectors and style definitions you can use.
http://www.w3schools.com has good CSS & (X)HTML tutorials tutorial.
|