A Beginners Guide: What is CSS?
CSS is the abbreviated version of Cascading Style Sheet/s — the "language" usedto customise and style webpages. 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
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
tag, with the appropriate attributes, for every paragraph. One lineof 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.