Previous Message
Next Message

Re: [css-d] Evenly spaced navigation

Sent by Simon Willison on 8 July 2002 17:05


At 19:58 07/07/2002 +0100, Drew McLellan wrote:
>I'm trying to get 5 navigation links to space themselves evenly across the 
>width of their parent. It works in IE5, but not in IE6 or moz1. The <a> 
>tags appear to be getting their width from the page rather than from 
>#mainnav. Hence, they are rendered too wide and wrap [...]
>
><div id="mainnav">
>         <a href="/" title="News and home" class="alink">News</a>
>         <a href="/pain/" title="Pain: tutorials" class="alink">Pain</a>
>         <a href="/grow/" title="Grow: extensions" class="alink">Grow</a>
>         <a href="/soap/" title="Soap: articles" class="alink">Soap</a>
>         <a href="/dwwd/" title="Read: my book" class="alink">Read</a>
></div>

I can't help you with your CSS problem, but I have got an accessibility tip 
which might be of interest. Bobby has a hissy fit if you have a page with 
links and no space between them, and it can look a bit confusing in 
browsers that don't support CSS. My solution is to separate links with this:

<span class="linkSpacer"> | </span>

Then add this to your stylesheet:

.linkSpace {
   display: none;
}

That should keep both Bobby and CSS free browsers happy.

Regards,

Simon Willison
Previous Message
Next Message

Message thread: