Site sections

Headings as images - The Lindsay method

Russ Weakley
01-Aug-03

There has been a lot written lately about how to use CSS-based images for headings in order to keep presentation seperate from content.

Apart from using inline images for headings, or the slightly more semantic option of wrapping these inline images inside HTML heading tags, there are many CSS-based and flash-based methods available. Each of them has advantages and disadvantages.

The Lindsay method

The Lindsay method uses existing elements as a starting point for CSS. The H3 is given a background image through CSS but the actual H3 text is still on the page, just hidden by making it very small, and of similar colour to the background of the image.

Advantages:

Disadvantages:

Heading here

HTML

<hx id="sample4">
Heading here
</hx>

CSS

#sample4
{
width: 400px;
height: 100px;
background-image: url(heading.jpg);
background-repeat: no-repeat;
font-size: 1px;
color: #fff;
}