[thelist] IE 5.0 PC and CSS inline elements

fstorr fffrancis at fstorr.demon.co.uk
Fri Oct 4 16:30:00 CDT 2002


>>I am trying to create a horizontal nav bar using A tags and CSS. I
>>have assigned padding, borders, etc. to the tags, but IE 5.0 PC
>>doesn't supportinline padding or border. Are there any CSS workarounds

>>to present different CSS to IE 5.0 PC only, so I don't have to use
>>browser detection or a nav bar of images.
>
>The Box Model Hack will present different CSS
>to IE5.x.

++++++++++++++

Hi

You can do this using an unordered list.  I've got it working on IE5 on
my company's intranet and it works perfectly (and also does in IE6, NS7
and Moz1.1).  Try this for the css (and take out the what you don't need
from the ul#globalnav bit):

ul#globalnav {
padding:1px 5px 1px 5px;
text-align:center;
}

#globalnav li {
display:inline;
}

Then it's just a case of:

<ul id="globalnav">
<li><a href="foo.com">a link</a></li>
<li><a href="bar.com">another link</a></li>
</ul>


With this, you've also got the advantage that, if anyone's css is turned
off, they just get an unordered list, which does the job just fine.

Hope this helps


Francis






More information about the thelist mailing list