SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    You want what? By when?? Milamber's Avatar
    Join Date
    Jan 2001
    Location
    California
    Posts
    342
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Unhappy IE7 Drop Down CSS Menu Fails To Expand Block Element?

    I'm trying to create a drop down menu and I've got it working in FF and Opera, and mostly in IE 7. However, for some reason the submenu links in IE7 aren't expanding to the full width of the submenu's UL tag.

    An example is in order here: http://jrm.cc/extras/ie7-test.html

    What I can't figure out is: how do I fix the a tag to be the full width of the menu in IE 7?

    Attached a SS of the menu in FF2, Opera9, and IE7.
    Attached Images Attached Images

  2. #2
    SitePoint Wizard bronze trophy Centauri's Avatar
    Join Date
    May 2007
    Location
    Newcastle, Australia
    Posts
    3,718
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You are specifying that the sub menu <li>s should be 100% width, but 100% of what? - there is no width specified for the sub menu <ul>s so that the 100% setting is being ignored. It is only luck that it is working in FF, the <ul> seemly inhereting the width of the parent <li> even though the <ul> is absolutely positioned. Setting a width for the submenu <ul>s cures the problem.

  3. #3
    The CSS Clinic is open silver trophybronze trophy
    Paul O'B's Avatar
    Join Date
    Jan 2003
    Location
    Hampshire UK
    Posts
    40,353
    Mentioned
    179 Post(s)
    Tagged
    6 Thread(s)
    As Centauri already said (because he was quicker than me )

    Code:
    ul.menu{width:100&#37;}

  4. #4
    You want what? By when?? Milamber's Avatar
    Join Date
    Jan 2001
    Location
    California
    Posts
    342
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Fair enough, but not quite what I'm looking for...

    Is there, perhaps, a way to get the submenu width to be as wide as it need be automatically? EG: As wide as the widest a tag?

    If nothing, width 150px on the ul li ul will do the trick
    -Jeff Minard | jrm.cc - Battlefield 2 Stats

  5. #5
    The CSS Clinic is open silver trophybronze trophy
    Paul O'B's Avatar
    Join Date
    Jan 2003
    Location
    Hampshire UK
    Posts
    40,353
    Mentioned
    179 Post(s)
    Tagged
    6 Thread(s)
    Hi,

    If you want an all fluid level menu that depends on the width of the content then it gets very complicated.

    I have a demo here that shows how to do it but properties are critical so you may find it awkward to change.

    http://www.pmob.co.uk/temp/dropdown-all-fluid.htm


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •