CSS — Cascading Style Sheet(s) — the “language” used to customise and style web pages. Almost everything you see on this page has been customised one way or another by CSS. The size and colour of the font (the font itself!), the position of the content and sidebar, how much space between the two sections, the header, the background: all CSS.
CSS can be ‘served’ three ways:
- In an external stylesheet
- In the head of the document
- Inline: inside each tag
Each of these ways has “priority” over the other, in the order specified above — styling in the head takes priority over the external stylesheet, styling inline takes priority over the stuff in the head and the external stylesheet. For example, if you set the font colour to black in your external stylesheet, red in the head and blue inline, the font will appear blue. This is the Cascade part of CSS. While there is more to the cascade than this, as long as you grasp this you’ll be fine.
Why Should *I* Use CSS?
Because it’s convenient, faster-loading, space-saving and allows for more flexibility. Take font customisation for example: do it the old way and you have to specify the
<font> tag, with the appropriate attributes, for every paragraph. One line of CSS in an external stylesheet and you can customise every paragraph on every page. What’s more, as the stylesheet will be treated as a page in its own right and will be cached, it will allow even new pages to load faster.
If you’re like me and change the look of your website every few weeks, CSS will make that easier too. Instead of having to edit every single page to switch one little detail you can alter a line of CSS and create an entirely new layout.
How Do I..?
Ah, well, that’s what the rest of the tutorials are for…