13.02.2013 Views

WEB STANDARDS CREATIVITY

WEB STANDARDS CREATIVITY

WEB STANDARDS CREATIVITY

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

44<br />

Spit and polish<br />

There are a few extra details that could go unnoticed if I don’t mention them specifically. For example, the logo at the top<br />

left of the layout could have easily been included in the main band photo, reducing the number of images needed to produce<br />

the page. However, making the logo a separate image file allowed me to set it as the background of the tag, and<br />

make the tag (and thus the logo) a link to the homepage:<br />

Here’s the XHTML:<br />

<br />

Lifehouse<br />

<br />

And here’s the CSS:<br />

h1#logo {<br />

position:absolute;<br />

z-index:100;<br />

left:29px;<br />

top:39px;<br />

margin:0;padding:0;<br />

}<br />

h1#logo a {<br />

display:block;<br />

background:url(../i/logo_lifehouse.gif) no-repeat;<br />

width:38px;<br />

height:175px;<br />

text-indent:-5000px;<br />

}<br />

Et voilà, I now have a clickable logo.<br />

Using Firefox? You have probably noticed that this image replacement technique (Mike Rundle’s Phark method, mentioned<br />

earlier) causes that browser’s dotted link borders to extend all the way to the left edge of the browser window when clicked,<br />

which isn’t very attractive. Luckily, this can be easily fixed by dropping a {outline:none;} into your style sheet. Figure 2-9<br />

show the before and after effects.<br />

Another item of note is the primary navigation (...), which gets marked up as a simple unordered list.<br />

Luckily, the navigation wasn’t generated by the CMS, but could be marked up by hand and included server-side on all pages<br />

of the site, since as I mentioned earlier, the CMS output templates didn’t include lists. The navigation bar uses a simplified<br />

variation of the technique known as the Navigation Matrix (Navigation Matrix Reloaded, http://superfluousbanter.org/<br />

archives/2004/05/navigation-matrix/) to create the image-based navigation and hover effects. The entire navigation is<br />

created using only one image (nav_matrix.gif) referenced in the CSS, as shown in Figure 2-10.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!