Using CSS

Style Sheets

Created and designed by Vivienne Trulock for ilikecake, 2007

Style sheets are a way of ensuring that all the elements of a page - header, paragraph etc. - are consistant from one page to the next. Style sheets can also be used to layout a page.

There are different versions of CSS. Style sheets can be written in CSS1 or CSS2. CSS 3 is currently under development. CSS1 is easlier to read as each element is coded separately. CSS2 is a later version of CSS and is much more difficult to read without prior studying. Throughout the site, both examples of CSS1 and CSS2 will be given where possible.

Style sheets can be

There are several different flavours of style sheets.

  • The simplest type of style is to style an existing HTML tag
  • You can also create customised styles if you just want to apply a certain font size or colour etc to a small amount of text. The are called class styles
  • The third type of style references the ID of an element and is normally referred to as advanced styles
  • There are also pseudo-classes which allow you to style a HTML element in different states, for example the hover state of an <a> or hyperlink tag.