CSS Analogy



index
Disabled back button Next Section
printable version

Section 1: Introduction

Here's an analogy to explain the relationship between HTML and CSS.

HTML provides the structure (and often the content) of a document.

Think in terms of the Mr. Potato Head toy that all Idaho children are required by law to have.

Section 2: Styles

CSS offers a variety of ways to dress up, or format, an HTML document, just like the parts that can be used to "decorate" a Mr. Potato Head body:

Hats
Eyes
Glasses
Noses Tater Nose. Tater Nose 2.
Mustaches
Mouths
Ears
Arms
Shoes
Accessories

You can mix and match the Mr. Potato Head parts to determine how he (or she) looks.

Section 3: Styles Applied

By applying different styles to an HTML document, you can change its appearance, just like with Mr. Potato Head.

Here's an example of one HTML document (the potato) with one set of CSS styles (or Mr. Potato Head accessories) applied:

First Potato Head..

Now here is the bland tater with yet another set of styles:

Second Potato Head.

And another...

Third Potato Head.

And the coup de grâce!

Best Potato Head.

The appearance of a single potato, or HTML document, can be drastically changed by the application of different accessories, or CSS styles.

Visit the CSS Zen Garden to see the impact of changing style sheets on a single HTML page.