In this fourth part of a seven-part series, I build the header section of a sample blog site. It will use another set of CSS sprites -- or, in other words, a different background image -- to decorate the sections comprising its navigation bar.
Creating an Artistic Blog Header with CSS Sprites - Review: building a stylish navigation bar with CSS sprites (Page 2 of 4 )
Before I get my hands dirty and start creating the header section of the example blog mentioned in the introduction, I'm going to reintroduce the full source code of the example developed in the previous part of this series. It showed how to exploit the functionality of CSS sprites for building an elegant, standards-compliant navigation bar.
Here's the background image that contains the set of CSS sprites required for defining the distinct sections of the bar. Take a look at it:
With the above graphic available for free manipulation via CSS, constructing an attractive navigation mechanism is as simple as coding the following web page:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse auctor commodo risus, et ultrices sapien vestibulum non. Maecenas scelerisque quam a nulla mattis tincidunt. Etiam massa libero, pharetra vel laoreet et, ultrices non leo. Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse auctor commodo risus, et ultrices sapien vestibulum non. Maecenas scelerisque quam a nulla mattis tincidunt. Etiam massa libero, pharetra vel laoreet et, ultrices non leo. Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse auctor commodo risus, et ultrices sapien vestibulum non. Maecenas scelerisque quam a nulla mattis tincidunt. Etiam massa libero, pharetra vel laoreet et, ultrices non leo. Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
</div>
<div id="footer">
<h2>Footer section</h2>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse auctor commodo risus, et ultrices sapien vestibulum non. Maecenas scelerisque quam a nulla mattis tincidunt. Etiam massa libero, pharetra vel laoreet et, ultrices non leo. Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse auctor commodo risus, et ultrices sapien vestibulum non. Maecenas scelerisque quam a nulla mattis tincidunt. Etiam massa libero, pharetra vel laoreet et, ultrices non leo. Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse auctor commodo risus, et ultrices sapien vestibulum non. Maecenas scelerisque quam a nulla mattis tincidunt. Etiam massa libero, pharetra vel laoreet et, ultrices non leo. Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
</div>
</div>
</body>
</html>
There you have it. A little bit of editing work in Photoshop (or the image editor of your choice) along with a pinch of CSS and clean, uncluttered markup make it possible to build a multi-state link bar, which can be used in several web sites with minor modifications. Naturally, this example would be incomplete if I don’t show you the output that it generates, so here it is.
In addition, CSS sprites are so flexible that it’s feasible to use the same markup of the previous web page to create an entirely different design. To demonstrate this, in the segment to come I’ll be defining the header section of a blog website, which will be the foundation for a brand new CSS sprite-based navigation bar.
But keep in mind that this is a work in progress, so for the moment I’ll be focused on constructing the header. Therefore, to learn the details of this process, click on the link below and read the next section.