This forum is now read-only. Please use our new forums! Go to forums

banner
Close banner
0 points
Submitted by Danfoster
almost 9 years

What is css used for?

I do not understand what css is actually used for.

Can you tell me?

Thank you.

Answer 55a4d9f976b8fe364b0006b1

0 votes

Permalink

CSS is how we give our documents presentational rules without cluttering up the document itself. A well formed HTML document contains no presentational markup, only semantic and structural. By the same token, a well formed document contains no inline script, either. This is known as unobtrusive markup.

A raw HTML document doesn’t render that pretty, though. It’s raw and depends entirely on the default style rules of the browser which in most cases is pretty sparse, of necessity. To give our page visual value, we have the style sheet, which has a MIME type of its own, text/css. The browser recognizes this type and follows the built in specs to read and parse the selector rules in the sheet.

A document consists of all manner of nodes. The most common that we work with are, element, attribute and text nodes. With CSS selectors we can target any of these in both our static style sheet at load time, and in dynamic real time as the user interacts with the page.

points
Submitted by Roy
almost 9 years