Ken Ward's Cascading
Style Sheets Tutorial

[Main Site Page: Freeing the Mind]
[Cascading Style Sheets: Contents]
[Previous: Declarations]
[This Page: Headings]
[Next: Alignment]

Headings

We can control which font is used for heading by specifying the font for the heading selectors.

There are 4 standard fonts:

They are illustrated below along with the examples of the Headings.

I am a serif H1

I am a serif H2

I am a serif H3

I am a serif H4

Our code is:

H1,H2,H3,H4 {font-family: serif;colour:#0000ff}

I am a paragraph, so I have default properties (whatever they are on your computer!) Unlike properties for the body, the properties for elements, such as the headings do not affect the properties of other parts of the document.

I am a sans-serif H1

My code is:

H1 {font-family: sans-serif}

I am cursive

My code is:

H1 {font-family: cursive}

I am fantasy

My code is:

H1 {font-family: fantasy}

I am monospace

My code is:

H1 {font-family: monospace}

Let's look at the Alignment selector in more more detail.

| Contents |