demosthenes.info

A blog by Dudley Storey on , , , , , , and anything else that strikes his fancy.

featured articles

popular favourites

Introduction to CSS

So far we have covered the XHTML required to markup a page. XHTML wraps around the content of the page, telling the content what it is (a paragraph, heading, etc). For appearance, we turn to CSS.

Web Technologies
XHTMLCSS
contentappearance
“what something is”“how something looks”
semantic markup of datarules for appearance of content

The CSS acronym is best explained in the following order:.

Styles

Rules governing the appearance of web page content.

Sheets

The rules are predominantly in a document, or several documents, that as separate from the HTML: a separate “sheet” (although they do not have to be).

Cascading

These rules can have various priorities, meaning that the appearance of the page can adjust to various circumstances (for example, different rules might cover the appearance of a web page when it is printed versus when it is displayed on the screen). The rules can also be overlapping, syncretic or conflicting: if more than one rule commands the appearance of an element, CSS sorts out which style rule takes priority.

CSS gives several advantages over alternative methods of determining the appearance of web pages:

  1. It separates appearance from content, meaning that one can be changed without having to adjust or untangle the other.

  2. The ability to very quickly change the overall look of a site, or to optimize the appearance of the site for different users (for example a style sheet that governs the appearance of the site for iPhone users, or the blind).

  3. They assure consistency of appearance across pages of a web site.

  4. They add powerful techniques in dealing with advanced features of HTML, such as <div>.

web developer guide

featured comment

by JoelB in Goodbye, JQuery Validation: HTML5 Form Errors With CSS3

what i'm reading

A Storm of Swords: A Song of Ice and Fire: Book Three
A Storm of Swords: A Song of Ice and Fire: Book Three

what i'm watching

Californication: The Third Season
Californication: The Third Season

what i'm playing

Mass Effect 3 Collector's Edition
Mass Effect 3 Collector's Edition

what i'm hearing

Dub FX
Dub FX

blogs

podcasts

no ads ever

This blog is free of advertising, and always will be.

creative commons licensed

The content of this blog is free to use in whatever way you wish under the Creative Commons license.