Reply LinkBack Thread Tools Search this Thread
Old 15-04-2008, 17:02   #1 (permalink)
jcharnley
Registered User
 
jcharnley's Avatar
 
Join Date: Dec 2007
Location: Denmark 4600
Posts: 82
CSS problem: LI A Span width in a floating menu, for ie6

hey guys, I have this menu:

<ul>
<li><a><span>menu01</span></a></li>
[...]
</ul>

i am using CSS to make the li float left and and the anchor for the :hover effect (the span is for a "end" background picture).

Problem is with the width in IE6

if i don't define a width.value the li goes 100%, which looks crap.
if i define a width.value then the value is working as a min-width, but if the menu is in several words, it goes to the next line, which also looks crap.

anyone have a solution for this?
  Reply With Quote
Old 15-04-2008, 17:07   #2 (permalink)
herkalees
Semantics, yay.
 
herkalees's Avatar
 
Join Date: Nov 2005
Location: Salem, Massachusetts
Posts: 1,128
A floated <li> (or any floated element) should never be block-level, as you describe it. Something in your cascade might be making this happen. Can we see a link to the page online?
__________________
  Reply With Quote
Old 15-04-2008, 17:24   #3 (permalink)
jcharnley
Registered User
 
jcharnley's Avatar
 
Join Date: Dec 2007
Location: Denmark 4600
Posts: 82
yea, just uploaded it.

Forside - Køge Ridelaug <!-- the main menu (eg forside, etc etc)
  Reply With Quote
Old 15-04-2008, 17:37   #4 (permalink)
Limbo
Baskin'
 
Join Date: Feb 2005
Posts: 5,619
Quote:
Originally Posted by herkalees
A floated <li> (or any floated element) should never be block-level, as you describe it.

Hi herk, why not? I do it all the time to make link lists so would like to know if I'd be better off trying sommit else..?
__________________
  Reply With Quote
Old 15-04-2008, 17:39   #5 (permalink)
Limbo
Baskin'
 
Join Date: Feb 2005
Posts: 5,619
Quote:
Originally Posted by jcharnley
Forside - Køge Ridelaug <!-- the main menu (eg forside, etc etc)

looks ok from here..?
__________________
  Reply With Quote
Old 15-04-2008, 18:45   #6 (permalink)
pgo
Senior Member
 
Join Date: Jan 2005
Posts: 12,340
Quote:
Originally Posted by herkalees
A floated <li> (or any floated element) should never be block-level
Huh? If you float something it is automatically made into a block-level element. Albeit one that partially ignores the document flow...
  Reply With Quote
Old 15-04-2008, 18:48   #7 (permalink)
jcharnley
Registered User
 
jcharnley's Avatar
 
Join Date: Dec 2007
Location: Denmark 4600
Posts: 82
Quote:
Originally Posted by Limbo
looks ok from here..?

yea, in Firefox, opera, safari, and IE>6 .... but not ie6 and under. Then it treats the floated <li>, as described earlier.
  Reply With Quote
Old 15-04-2008, 21:04   #8 (permalink)
herkalees
Semantics, yay.
 
herkalees's Avatar
 
Join Date: Nov 2005
Location: Salem, Massachusetts
Posts: 1,128
Quote:
Originally Posted by pgo
Huh? If you float something it is automatically made into a block-level element. Albeit one that partially ignores the document flow...
I'm either going crazy, or I remember when floating a block-level element, it becomes only the width of it's contents.

...or do I always have a width set when I do it?
__________________
  Reply With Quote
Old 16-04-2008, 10:18   #9 (permalink)
jcharnley
Registered User
 
jcharnley's Avatar
 
Join Date: Dec 2007
Location: Denmark 4600
Posts: 82
No solution?
  Reply With Quote
Old 17-04-2008, 03:14   #10 (permalink)
hawken
Cornish Pasty
 
hawken's Avatar
 
Join Date: Nov 2003
Location: Tokyo, Japan
Posts: 2,707
Send a message via MSN to hawken
why are you putting a link around a block element anyway? isn't this illegal markup?
__________________
  Reply With Quote
Old 17-04-2008, 03:31   #11 (permalink)
Limbo
Baskin'
 
Join Date: Feb 2005
Posts: 5,619
He's not.

A span is not a block level element - that's the point. You use CSS to do the block bit so the link can be turned into a button and the text can be hidden, but the HTML remains semantic.
__________________
  Reply With Quote
Old 17-04-2008, 13:51   #12 (permalink)
jcharnley
Registered User
 
jcharnley's Avatar
 
Join Date: Dec 2007
Location: Denmark 4600
Posts: 82
@ hawken
look it up: HTML SPAN TAG

@ anybody
Still no ideas how to fix ie6's behaviour? How do you usually set up a listed menu width <span> inside?
  Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search


Contact Us - Web Design Forums - Archive - Top
Search Engine Optimization by vBSEO 3.0.0 RC8