Not signed in (Sign In)

SkillShare - A place to discuss Web Standards and Web Design topics

Categories

Vanilla 1.1.9 is a product of Lussumo. More Information: Documentation, Community Support.

    • CommentAuthorrymercho
    • CommentTimeMar 13th 2009
     permalink
    Hi
    I have an old problem but it is new to me, I have crawled the web this morning and to no avail. The problem is I have a navbar with consisting of ul and a with a background image set to change on hover. FF, SAFARI and OPERA view it OK but the dreaded IE6 still plagues me. I can get all the li's to display the correct widths but they are all underneath each other, I am sure it is something simple. Here is the code:

    <div id="header">
    <div id="h_left"></div>
    <div id="h_middle">
    <div id="logo"><img src="../images/commlogo.png" alt="communiq8" width="188" height="22" /></div>
    <div id="nav">
    <ul>
    <li><a href="sorry.html?phpMyAdmin=4594f30712f4fabaff6997416810f3f2">CONTACT</a></li>
    <li><a href="pc_support.html?phpMyAdmin=4594f30712f4fabaff6997416810f3f2">PC SUPPORT</a></li>
    <li><a href="sorry.html?phpMyAdmin=4594f30712f4fabaff6997416810f3f2">WEB DESIGN</a></li>
    <li><a href="sorry.html?phpMyAdmin=4594f30712f4fabaff6997416810f3f2">GRAPHIC DESIGN</a></li>
    <li><a href="index.html?phpMyAdmin=4594f30712f4fabaff6997416810f3f2">HOME</a></li>
    </ul>
    </div>
    </div>
    <div id="h_right"></div>
    <div class="push"></div>
    </div>

    #nav {
    height: 34px;
    margin: 0px;
    padding: 0px;
    float: right;
    width: 72%;
    }
    #nav ul {
    list-style-type: none;
    padding: 0px;
    margin: 0px;
    display: block;
    }
    #nav li {
    display: block;
    border-left-width: 1px;
    border-left-style: solid;
    border-left-color: #CCCCCC;
    height: 34px;
    margin: 0px;
    padding: 0px;
    float: right;
    }
    #nav a {
    font-size: 0.7em;
    color: #000000;
    text-decoration: none;
    background-image: url(../images/nav_grad.png);
    background-repeat: repeat-x;
    background-position: left top;
    padding-right: 20px;
    padding-left: 20px;
    margin: 0px;
    padding-top: 10px;
    padding-bottom: 0px;
    text-align: center;
    height: 24px;
    float: right;
    display: block;
    width: auto;
    }
    #nav a:hover, #nav a:active {
    font-size: 0.7em;
    color: #000000;
    text-decoration: underline;
    background-image: url(../images/nav_grad_hover.png);
    background-repeat: repeat-x;
    background-position: left top;
    padding-right: 20px;
    padding-left: 20px;
    display: block;
    margin: 0px;
    padding-top: 10px;
    padding-bottom: 0px;
    text-align: center;
    height: 24px;
    float: right;
    width: auto;
    }

    There maybe a few sloppy mistakes in there as I have been messing with it but any help or explaination would be appreciated. Thanks Chris
  1.  permalink

    Does it look like a staircase? The menu, that is.

    Like this:

    link

    link

    link

    instead of this: link | link | link

    Thankful People: Falcon
    • CommentAuthorrymercho
    • CommentTimeMar 13th 2009
     permalink
    more like:


    | link
    | link
    | link
    | link

    as opposed to:

    | link | link | link | link

    The '|' indicates the border on the right and it is visible in IE. I am at a loss. I really hate these IE bugs.

    If you want to look it is: communiq-8 dot co dot uk
    • CommentAuthorrymercho
    • CommentTimeMar 13th 2009 edited
     permalink
    Hey I fixed it!

    I just stripped the whole page down a checked it in IE5 on the mac there was a style element that I had been using to force boxes to clear: both which was making other elements inherit that property!

    Similarly with the navigation I removed #nav ul and #nav li it immediately put things it the stepped layout you described. I then re-did it, when I added the ul style '#nav ul {list-style-type: none;}' it fixed it without the need for the li to have even display: block. Which I have not done before, I think I am used to the tutorials on drop menus and this maybe where this comes from.

    All the dislpay: block elements are applied in the <a href> tags. I am happy with it now, even the smallest suggestion can make you think. That why I like forums like this.

    Site working without an IE workaround insight, Thanks for the kick start.

    Maybe I will keep the word 'Professional' on my site after all!
    • CommentAuthorrymercho
    • CommentTimeMar 13th 2009
     permalink
    DOH! just gone back and it works in IE on the mac but now has the stepped problem you described on your previous post. damn it!

    HElp!
  2.  permalink

    You'll probably just need to set the LI width to auto to make them play nice. So,

    #nav li {
    width:auto;
    ...
    

    should work.

    • CommentAuthorrymercho
    • CommentTimeMar 13th 2009
     permalink
    yeah, auto wasn't working right!

    I ended up putting in fixed widths, which I didn't really want to do. But that seemed to work, although my HOME navigation is now too wide and one of the others is a wee bit too short. Maybe I will have another go later.

    Right tent, wrong Desert!

    Thanks for the tip
    • CommentAuthorsms
    • CommentTimeMar 20th 2009
     permalink
    You don't have to use fixed width, here is the (shortened) CSS you need:

    #nav {
    height: 34px;
    margin: 0;
    padding: 0;
    float: right;
    width: 72%;
    }

    #nav ul {
    list-style-type: none;
    padding: 0;
    margin: 0;
    }

    #nav li {
    border-left-width: 1px;
    border-left-style: solid;
    border-left-color: #ccc;
    height: 34px;
    margin: 0;
    padding: 0;
    float: right;
    }

    #nav a {
    font-size: 0.7em;
    color: #000;
    text-decoration: none;
    background: url(../images/nav_grad.png) repeat-x left top;
    padding: 10px 20px 0 20px;
    margin: 0;
    text-align: center;
    height: 24px;
    }

    #nav a:hover, #nav a:active {
    text-decoration: underline;
    background: url(../images/nav_grad_hover.png);
    }
    • CommentAuthorFalcon
    • CommentTimeMay 7th 2009
     permalink
    Hi Kari.patila,

    I have a problem with a ul in IE7 that is staircased like you mentioned. Do you have any ideas - (or should I start a new thread and post my code)
  3.  permalink
    The solution is somewhere among the code samples in this thread, I think, but you could post your code here just as well. I can't test it myself right now, unless IE8 has the same problem, but I'm sure someone else will come up with a fix in no time.
    • CommentAuthorFalcon
    • CommentTimeMay 8th 2009
     permalink
    Ok thanks kari.patila - here goes guys. It would be great if you could help me. The whole site I have built validates XHTML 1.0 Transitional except IE 8 shows a strange stepped menu (staircase as referenced above). Here is the HTML:

    <div id="banner" ><img src="most-subscribed-images/header.jpg" width="960" height="81" alt="Most Subscribed title" />
    <div id="navDiv">
    <ul id="nav">
    <li id="nav_hom"><a href="home.php?phpMyAdmin=4594f30712f4fabaff6997416810f3f2">home</a></li>
    <li id="nav_map"><a href="about.php?phpMyAdmin=4594f30712f4fabaff6997416810f3f2">about</a></li>
    <li id="nav_jou"><a href="slideshow.php?phpMyAdmin=4594f30712f4fabaff6997416810f3f2">photos</a></li>
    <li id="nav_his"><a href="models.php?phpMyAdmin=4594f30712f4fabaff6997416810f3f2">cast</a></li>
    <li id="nav_ref"><a href="behind-the-scenes.php?phpMyAdmin=4594f30712f4fabaff6997416810f3f2">on location</a></li>
    </ul>
    </div>
    </div>

    and the relevant CSS:

    #nav {
    margin: 0;
    padding: 0;
    list-style-type: none;
    }

    #navDiv {
    margin: 0px auto;
    width: 635px;
    /*width: 635px;*/
    }



    #nav li {
    padding: 0;
    margin: 0;
    }

    #nav a {
    float: left;
    width: 127px;
    color: #d00;
    text-decoration: none;
    line-height: 44px;
    text-align: center;
    background-image: url(most-subscribed-images/tab.gif);
    background-repeat: no-repeat;
    }

    #nav #nav_con a {
    border: none;
    }

    #nav a:hover {
    background-position: -127px 0;
    color: #fff;
    }
Add your comments
    Username Password
  • Format comments as (Help)