#1
  1. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Jan 2004
    Posts
    996
    Rep Power
    16

    Help with drop down menu


    Hi,

    I have this drop down menu, but the parents are appearing under each other, instead of next to each other. I am trying to create a horizontal menu with sub items appear under the parent items.

    this is my code:

    PHP Code:
    #menu2 {
    width800px;
    float:left
    }

    #menu2 ul {
    list-stylenone;
    margin0;
    padding0;
    width12em;
    floatleft;
    }

    #menu2 a, #menu2 h2 {
    fontbold 11px/16px arialhelveticasans-serif;
    displayblock;
    border-width1px;
    border-stylesolid;
    border-color#ccc #888 #555 #bbb;
    margin0;
    padding2px 3px;
    }

    #menu2 h2 {
    color#fff;
    background#000;
    text-transformuppercase;
    }

    #menu2 a {
    color#000;
    background#efefef;
    text-decorationnone;
    }

    #menu2 a:hover {
    color#a00;
    background#fff;
    }

    #menu2 li {position: relative; float:left; width: 200px;}


    a.mainlevel{background-color#000000!important; display:inline-block}

    #menu2 ul ul {
    positionabsolute;
    z-index500;
    float:left
    }

    #menu2 ul ul ul {
    positionabsolute;
    top0;

    }

    div#menu2 ul ul,
    div#menu2 ul li:hover ul ul,
    div#menu2 ul ul li:hover ul ul
    {displaynone;}

    div#menu2 ul li:hover ul,
    div#menu2 ul ul li:hover ul,
    div#menu2 ul ul ul li:hover ul
    {displayblock;} 
    Can anyone see anything wrong?

    Many thanks
  2. #2
  3. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2009
    Location
    Hobart, Tasmania
    Posts
    475
    Rep Power
    291
    You've mixed position and float attributes in exotic ways, do you understand how they'll render? Just sayin' .... unless you're the CSS guru ... this might be a "tad" ambitious.
    Latery Matey
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Jan 2004
    Posts
    996
    Rep Power
    16
    Hi
    Thanks for the reply.

    It was actually a script I picked up somewhere else. Could you explain to me about how the floats and positions should be?

IMN logo majestic logo threadwatch logo seochat tools logo