Page 1 of 2 12 LastLast
Results 1 to 10 of 14

Thread: CSS Hacks for positioning in IE

  1. #1
    Join Date
    Aug 2006
    Posts
    19
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default CSS Hacks for positioning in IE

    I have a menu that I am trying to implement on a client's website. Using CSS hacks for IE is somewhat new to me, and I'm having a hard time getting them to work.

    In IE7, everything is working beautifully except for the fact that the whole thing is two pixels off in position. Here's my attempted fix:

    Code:
    .arrowlistmenu{
    width: 194px; /*width of accordion menu*/
    position: relative;
    top: -4px;
    }
    
    body > .arrowlistmenu{
    left: -2px;
    top: -6px;
    }
    However, it doesn't seem to be doing anything. The menu is still sitting in the same spot. Does anyone know if I've set something up wrong?

    Also, after I solve this, I am going to have to throw in a lot of CSS hacks to strip out much of the padding for IE6. Does anyone have a suggestion for the best way to do this?

    Thanks

  2. #2
    Join Date
    Jan 2006
    Location
    Ft. Smith, AR
    Posts
    795
    Thanks
    57
    Thanked 129 Times in 116 Posts

    Default

    I'd recommend using margin to adjust rather than position.

    something like:

    Code:
    <!--[if IE]>
    <style type="text/css">
    .arrowlistmenu{
    width: 194px; /*width of accordion menu*/
    position: relative;
    margin:-4px 0 0 0;
    }
    
    body > .arrowlistmenu{
    margin: -6px 0 0 -2px;
    }
    </style>
    <![endif]-->
    --------------------------------------------------
    Reviews, Interviews, Tutorials, and STUFF
    --------------------------------------------------
    Home of the SexyBookmarks WordPress plugin

  3. The Following User Says Thank You to TheJoshMan For This Useful Post:

    jimbob79 (11-08-2008)

  4. #3
    Join Date
    Aug 2006
    Posts
    19
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default

    Thanks for the suggestion. Unfortunately, margin vs. positioning doesn't really seem to be the root of the problem. I switched back to using conditionals instead of the nesting hack, but it really isn't making any difference:

    Code:
    <!--[if IE]>
    .arrowlistmenu{
    position: relative;
    top: -6px;
    left: -2px;
    }
    <![endif]-->
    Even with that in the stylesheet, IE7 just doesn't seem to be picking it up. The menu is still displaying out of position. However, I made a copy of the HTML file and attached a different stylesheet with that positioning in it (rather than the original) and the menu positioning itself where it was supposed to be:

    Code:
    .arrowlistmenu{
    width: 194px; 
    position: relative;
    top: -6px;
    left: -2px;
    }
    ... which leads me to think I'm somehow doing something wrong with my conditionals and/or hacks. Any thoughts?

    And once I figure this out, I'm going to have to do it all again for IE6. So, which method do you all recommend for making a bunch of IE6 fixes too?

  5. #4
    Join Date
    Jan 2006
    Location
    Ft. Smith, AR
    Posts
    795
    Thanks
    57
    Thanked 129 Times in 116 Posts

    Default

    this would really be easier and quicker to solve if we could see a link to the test page you're working with.
    --------------------------------------------------
    Reviews, Interviews, Tutorials, and STUFF
    --------------------------------------------------
    Home of the SexyBookmarks WordPress plugin

  6. The Following User Says Thank You to TheJoshMan For This Useful Post:

    jimbob79 (10-14-2008)

  7. #5
    Join Date
    Aug 2006
    Posts
    19
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default

    You're right. I should have posted links earlier. Sorry about. (And thank you for the help!)

    Here is one version with some conditionals to get the menu in the right spot:
    http://www.bluetears.com/tbg_test/ae...olumn_V02.html

    The .css file in question is http://www.bluetears.com/tbg_test/aer/css/ac_menu.css

    Here is a second version made just for IE with no conditionals and no hacks:

    http://www.bluetears.com/tbg_test/ae...n_V02_IE7.html

    And the .css file for that is http://www.bluetears.com/tbg_test/ae...c_menu_ie7.css

    Obviously I can adjust things to get the menu in the right place (as seen on the second file)... but I need to have this done with only one HTML page, not two. Ideally, I'll put all of my IE-specific adjustments in their own .css file... but I'm having trouble getting that set up right.

  8. #6
    Join Date
    Jan 2006
    Location
    Ft. Smith, AR
    Posts
    795
    Thanks
    57
    Thanked 129 Times in 116 Posts

    Default

    ok, the only diff i'm noticing between the two links in IE7 is the heading of the sidebar nav... Is this the problem you're having? I thought you were talking about the main navigation (horizontal)
    --------------------------------------------------
    Reviews, Interviews, Tutorials, and STUFF
    --------------------------------------------------
    Home of the SexyBookmarks WordPress plugin

  9. The Following User Says Thank You to TheJoshMan For This Useful Post:

    jimbob79 (11-08-2008)

  10. #7
    Join Date
    Aug 2006
    Posts
    19
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default

    Right. The problem is the sidebar nav. The top nav seems relatively happy.

    ... and actually, I managed to figure that out at some point this evening. Thank you for your help though.

    Unfortunately, the sidebar nav is still causing me some serious headaches. Maybe you can shed some light on this instead.

    Here is the most current versions of the problem files:

    http://www.bluetears.com/tbg_test/ae...olumn_V02.html

    http://www.bluetears.com/tbg_test/ae...ss/ac_menu.css

    The basic problem is, most of my text and background colors are not showing up in IE6. Unfortunately, this has to be IE6-compatable. I think this is an issue with me screwing up my inheritance with having so many nested things, but I can't figure it out. Any hints regarding what I need to fix to get the sidebar nav in IE6 to look like the rest of the browsers (mostly in regards to colors and border styles - I know there's extra spacing... but that's less important) would be very appreciated.

    And if it helps, here's the script it's using:
    http://www.dynamicdrive.com/dynamici...enu-bullet.htm

    Thanks for any help!

  11. #8
    Join Date
    Aug 2006
    Posts
    19
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default

    Just as an update, I've been working and tweaking the CSS all night and made some adjustments. Most issues with IE6 have been resolved. The only thing that remains is that the background colors on the sidebar menu don't seem to like showing up. The files in the post above this will reflect all updates. They're still the most current versions.

  12. #9
    Join Date
    Jan 2006
    Location
    Ft. Smith, AR
    Posts
    795
    Thanks
    57
    Thanked 129 Times in 116 Posts

    Default

    if it's not already resolved by then, i'll take a look when i get home this afternoon
    --------------------------------------------------
    Reviews, Interviews, Tutorials, and STUFF
    --------------------------------------------------
    Home of the SexyBookmarks WordPress plugin

  13. The Following User Says Thank You to TheJoshMan For This Useful Post:

    jimbob79 (11-08-2008)

  14. #10
    Join Date
    Aug 2006
    Posts
    19
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default

    That would be fantastic. Thank you!

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
  •