Introduction to style sheets

The HTML4 way to control HTML output

From wordprocessors to DTP suites, even spreadsheets, text is laid out in a 'style' - a collection of properties that determine how that text is displayed. Fonts, font weight and size, justification, colour, alignment - all can be defined as part of the text style.

Now HTML4 and CSS not only bring styles to your web pages, but extend the nature of the style to include the precise position of the text elements, the visibility, movement (through Javascript), without losing the bonus of any style - updating every text block in one step just by changing the style properties.


A style sheet is based on rules - each with three parts

Selectors
An HTML tag, a class (see later) or an ID (enhanced version of the name attribute)

Properties
Tells the browser what part of the selected element to change

Values
What to change the property to become.

n.b. CodeHelp only uses full CSS on pages designed for IE4&5. Netscape Navigator up to release 4.6 does not support all CSS features. Check all pages in all versions before publishing.



This is part of www.codehelp.co.uk Copyright © 1998-2004 Neil Williams
See the file about.html for copying conditions.