Forum Moderators: not2easy

Message Too Old, No Replies

IE5 problem

links aren't linking

         

theonliest

6:01 pm on Jan 27, 2004 (gmt 0)

10+ Year Member



I have an IE5.0 specific problem..
I'm using the following code in my css to define some nav links:

a.navd2 {display:block;float:left;padding:0px;margin:5px;}

I need to use the 'float:left' to get the elements to line up horizontally on most browsers but this seems to deactivate the link on ie5.0 (well actually it doesn't 'seem to' it just does!) the links will open if you right click and 'Open Link' which is obviously completely useless,
I was thinking it might be IE5 not supporting 'block' on an <a> tag but the links do work if I get rid of the 'float:left'..

does anyone know a workaround that doesn't involve nesting each link in a hundred divs?!

isitreal

7:32 pm on Jan 27, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Just nest them all in one div, then put:

div.links {text-align:left;padding:0;}

And they should all line up.

theonliest

4:10 pm on Jan 28, 2004 (gmt 0)

10+ Year Member



I'm afraid that's not working, it's causing the elements to break onto the next line which isn't what I want, because they're block level they will automatically break but the 'float:left' is overriding this, so they all line up nicely but it leaves the links not working!

DrDoc

4:27 pm on Jan 28, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Do you need display:block and float:left? Why not just use white-space:nowrap on your links? They will still wrap to the next line, just not halfway through the link

theonliest

5:45 pm on Jan 28, 2004 (gmt 0)

10+ Year Member



I need, or rather I would prefer, to use 'display:block' as the nav graphics have transparent backgrounds with the background colo(u)r defined by the css so you have a nice coloured rectangular background which can change for the mouseover, if the <a> is not classed with 'display:block' then you get a strange effect in Netscape and Opera (and presumably all standards compliant browsers) where the background colour only appears at the bottom of the graphic and you don't get the rectangular effect.

To be honest I may have to ditch the 'display:block;float:left' business altogether if it means the links will work on all browsers but the background colour effect I'm trying only works on *$!*$!£* internet expolorer!

dr doc, not sure that the 'white-space:nowrap' makes any difference if I take the 'display:block' out, I haven't really used this selector before so I'm not sure wot it's supposed to be doing.