Results 1 to 2 of 2

Thread: drop-down menu help

  1. #1
    Join Date
    Jul 2010
    Posts
    1

    drop-down menu help

    I am having problem with a drop-down menu, i created the navigation menu but when you mouse-over the intended drop-down menu, it will display the children horizontally instead of vertically (downward).

    below is the html and css i used for the navigation, any help will be appreciated.

    the HTML:
    <div class="menu">
    <ul>
    <li><a href="index.html" class="active"><span>Home</span></a></li>
    <li><a href="about.html"><span>About </span></a></li>
    <li><a href="#"><span>Products</span></a>
    <ul class="dropdwn">
    <li><a href="#"><span>Home</span></a></li>
    <li><a href="#"><span>Office</span></a></li>
    <li><a href="#"><span>Custom</span></a></li>
    </ul>
    </li>
    <li><a href="#"><span>Sales</span></a></li>
    <li><a href="contact.html"><span>Contact</span></a></li>
    </ul>
    </div>
    the CSS:
    /* menu */
    .menu {
    padding:15px 0 0 20px;
    margin:0;
    width:550px;
    float:right;
    }
    .menu ul {
    text-align: left;
    padding:0;
    margin:0;
    list-style:none;
    border:0;
    float:right;
    }
    .menu ul li {
    float:left;
    margin:0;
    padding:0 5px;
    border:0;
    }
    .menu ul li a {
    float:left;
    margin:0;
    padding:12px 0;
    color:#fff;
    font:normal 12px Arial, Helvetica, sans-serif;
    text-decoration:none;
    }
    .menu ul li a span {
    padding:12px 9px;
    background:none;
    }
    .menu ul li a:hover {
    background: url(images/r_menu.gif) no-repeat right;
    }
    .menu ul li a:hover span {
    background:url(images/l_menu.gif) no-repeat left;
    }
    .menu ul li a.active {
    background:url(images/r_menu.gif) no-repeat right;
    }
    .menu ul li a.active span {
    background:url(images/l_menu.gif) no-repeat left;
    }
    /* drop down menu */

    .dropdwn {
    text-align: left;
    padding:0;
    margin:0;
    list-style:none;
    border:0;
    }
    .dropdwn li {
    float:left;
    margin:0;
    padding:0 5px;
    border:0;
    }
    .dropdwn li a {
    float:left;
    margin:0;
    padding:12px 0;
    color:#fff;
    font:normal 12px Arial, Helvetica, sans-serif;
    text-decoration:none;
    }
    .dropdwn li a span {
    padding:12px 9px;
    background:none;
    }
    .dropdwn li a:hover {
    background: url(images/r_menu.gif) no-repeat right;
    }
    .dropdwn li a:hover span {
    background:url(images/l_menu.gif) no-repeat left;
    }
    .dropdwn li a.active {
    background:url(images/r_menu.gif) no-repeat right;
    }
    .dropdwn li a.active span {
    background:url(images/l_menu.gif) no-repeat left;
    }
    any help will be appreciated.

  2. #2
    Join Date
    Feb 2006
    Location
    Salisbury UK
    Posts
    4,332
    It's float: left which is causing the horizontal dropdown tabs in this style, so delete it:-
    Code:
    .dropdwn li {
    /*float:left;*/
    margin:0;
    padding:0 5px;
    border:0;
    }
    I think you should be able to leave the float: left in the .dropdwn li a { } style.

    You may have to edit other things, but that should be a start.

    You might need to add a width to the .dropdwn li style.
    Code downloaded to my PC will be deleted in due course.
    WIN7; IE9, Firefox, Opera, Chrome and Safari for Windows; screen resolution usually 1366*768.
    Also IE6 on W98 with 800*600 and IE8 on Vista 1440*900.

Similar Threads

  1. Dropdown menu with css and javascript...?
    By AllanH in forum Client & Server Side Scripting (PHP, ASP, JavaScript)
    Replies: 1
    Last Post: 14 May 2009, 02:59 AM
  2. CSS Drop down menu in IE problem..
    By mylah in forum Web Design, HTML Reference and CSS
    Replies: 0
    Last Post: 24 Mar 2009, 08:41 AM

Posting Permissions

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