Bending the Matrix

For anyone who’s interested, here’s how I bent the navigation bar at the top of my site. It’s a variation of the Navigation Matrix posted on Superfluous Banter. (Spanish Language Version)

View my working demo.

We start with one Unordered List.

<ul id="nav">
  <li id="arc"><a href="/archives/">Archives</a></li>
  <li id="exa"><a href="/examples/">Examples</a></li>
  <li id="ctc"><a href="/contact/">Contact</a></li>
  <li id="ctb"><a href="/about/">About</a></li>
  <li id="lin"><a href="/links/">Links</a></li>
  <li id="fos"><a href="#">Small Font Size</a></li>
  <li id="fol"><a href="#">Large Font Size</a></li>
</ul>

For simplification purposes, I have removed the JavaScript for the Stylesheet Switcher.

Mix in One Image

Menu image thumbnailThe menu, from hereon referred to as “The Bend”, utilizes only one image (two if you count the large font version), and uses the CSS background-position property to control all rollover effects. View the menu image alone.

Apply CSS Liberally

The majority of the CSS tricks used are described in the Navigation Matrix article, but let I’ll go over what I did differently, and some extra things to consider for the curved nature of The Bend. I will explain the theory below.

As when dealing with anything on the web, The Bend must fit into a box. But The Bend is not a box. So, a little CSS tomfoolery must ensue.

First, we break The Bend up into its segments.

The Bend Broken into Segments

The overall height of The Bend is 73 pixels, each section having its own specific width. However, when you break it up this way, some of the buttons have lots of empty space around them, and could cause premature-highlighting.

Premature Highlighting

If we relate the overall impression of The Bend to an image with HTML hot spots, we need to shrink those hotspots to fit only the part of the button we want to use. We do this by supplying exact height values to each <a> tag, and specifying an exact margin-top to place it in its correct position. The result is pictured here.

Well Fitted Buttons

So that’s pretty much it. Throw in a little JavaScript, an alternate stylesheet, and it all fits together pretty well.

Post and Author Info.

Published March 08, 2005 by:

This article is tagged with and .

Commenting is currently off for this post.