This forum is now read-only. Please use our new forums at discuss.codecademy.com.

42 points
D80d51340de942e5b65d770dc607ae0f?s=140&d=retro
Submitted by
Danfoster
over 4 years ago

What is css used for?

I do not understand what css is actually used for.

Can you tell me?

Thank you.


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.

8995 points
5958b8ebe12813a2a3000034_980106998
Submitted by
Roy
over 4 years ago