SitePoint Sponsor

User Tag List

Results 1 to 5 of 5

Thread: Controlling Height. IE layout issue...

Hybrid View

  1. #1
    SitePoint Enthusiast
    Join Date
    Mar 2007
    Posts
    36
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Controlling Height. IE layout issue...

    I'm working on a website that uses a strict, fixed-size layout. There is a simple list-based navigation system on the left, and the main content in an area to the right.

    See the test page at: http://www.barberdesign.co.uk/duo/heathrow_express.html

    (Link to complete stylesheet: http://www.barberdesign.co.uk/duo/css/duo.css)

    CSS in question:

    #menu {
    position: absolute;
    width: 150px;
    background-color: #fff;
    font-size: 13px;
    z-index: 2;
    }

    ul#nav {
    list-style-type: none;
    width: 100%;
    }

    ul#nav li {
    height: 15px;
    line-height: 15px;
    }
    To complicate matters, the site area uses a mixture of Flash and HTML, to make the site move the way the client wants, but also be search engine friendly. To do this I've created separate divs to contain the HTML naviagtion, HTML content and Flash navigation/content, and stacked them using z-index with "w-mode: transparent" on the Flash.

    The problem I have is getting the list-based menu items to be the same height in all browsers. This is essential because the Flash will be in a fixed position, so if the HTML navigation comes down too low on one browser, it will overlap the Flash on some pages.

    At the moment it displays correctly in the modern standards compliant browsers, (Firefox Mac/PC, Opera Mac/PC, IE7, and Safari) but IE6 PC is showing the li's with a larger pixel height dimension, and therefore coming further down the page.

    Does anyone know how to force IE to display the li's at the height specified in the stylesheet?!

    Thank youuuuuuuuu!
    Last edited by Luther; Mar 21, 2007 at 13:54. Reason: Added the CSS in question

  2. #2
    SitePoint Enthusiast
    Join Date
    Mar 2007
    Posts
    36
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Sorry to bump, but it's a bit of an urgent problem to solve for me, and I'm sure it's a simple one for someone out there with a bit more experience!!

  3. #3
    The CSS Clinic is open silver trophybronze trophy
    SitePoint Award Recipient Paul O'B's Avatar
    Join Date
    Jan 2003
    Location
    Hampshire UK
    Posts
    37,784
    Mentioned
    99 Post(s)
    Tagged
    3 Thread(s)
    Hi,

    If you float the list and anchors for IE then it collapses all the white space bugs.

    Code:
    * html ul#nav li, 
    * html ul#nav li a{
    float:left;
    height:15px;
    overflow:hidden;
    clear:left
    }
    That makes it more or less the same as firefox.

  4. #4
    The CSS Clinic is open silver trophybronze trophy
    SitePoint Award Recipient Paul O'B's Avatar
    Join Date
    Jan 2003
    Location
    Hampshire UK
    Posts
    37,784
    Mentioned
    99 Post(s)
    Tagged
    3 Thread(s)
    BTW you can't use #nav more than once in your page and you should be using a class instead.

  5. #5
    SitePoint Enthusiast
    Join Date
    Mar 2007
    Posts
    36
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks!

    Actually before you posted, I found another solution. If I simply remove the "height: 15px;" declaration from the li selector, leaving only "line-height: 15px;", it works!!

    I think I will find your method useful in the future, however.

    And thanks for the class tip, that'll neated up my stylesheet

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
  •