Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8525633
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T08:02:25+00:00 2026-06-11T08:02:25+00:00

I have a menu that contains a submenu which gets displayed below the main

  • 0

I have a menu that contains a submenu which gets displayed below the main menu when a link inside the main menu is hovered over. What I want to do is add a second submenu inside the first submenu but make it a dropdown. I am not that great at css and I was wondering if anyone can help me with this. I haved followed some tutorials online and I was not able to get the results I was looking for. Here is the html and css I have so far.

<div id="navigation">
<ul id="mymenu">
    <li><a href="#" onmouseover="javascript:showsubmenu(1)">Home</a></li>
    <li><a href="#" onmouseover="javascript:showsubmenu(2)">Gallery</a></li>
    <li><a href="#" onmouseover="javascript:showsubmenu(3)">What We Do</a></li>
    <li><a href="#" onmouseover="javascript:showsubmenu(4)">Contact</a></li>
</ul>
</div>
<div id="sublinks">
<ul id="s1">
    <li><a href="#">General</a></li>
    <li><a href="#">Landon News</a></li>
    <li><a href="#">Trust Us</a></li>
</ul>
<ul id="s2">
    <li>
        <a href="#">Security Systems</a>
        <ul id="s2sys">
            <li><a href="#">Arlington HA</a></li>
            <li><a href="#">Enfield HA</a></li>
            <li><a href="#">Revere HA</a></li>
        </ul>
    </li>
    <li>
        <a href="#">WLAN Systems</a>
        <ul id="s2wlan">
            <li><a href="#">Beverly HA</a></li>
            <li><a href="#">Holyoke HA</a></li>
            <li><a href="#">Meriden HA</a></li>
            <li><a href="#">Revere HA</a></li>
        </ul>
    </li>
</ul>
<ul id="s3">
    <li><a href="#">Computers</a></li>
    <li><a href="#">Strategic Planning</a></li>
    <li><a href="#">Security Systems</a></li>
    <li><a href="#">WLAN, WiFi Broadband</a></li>
</ul>
<ul id="s4">
    <li><a href="#">Email</a></li>
    <li><a href="#">Address Info</a></li>
</ul>
</div>

Here is the javascript for the main menu which will display the first submenu

function showsubmenu(id){
    submenu = document.getElementById('s'+id);
    for(i=1;i<=4;i++){
        if(i==id){
            submenu.style.display="block";
        } else {
            document.getElementById('s'+i).style.display="none";
        }
    }
}
sfHover = function() {
var sfEls = document.getElementById("sublinks").getElementsByTagName("li");
for (var i=0; i<sfEls.length; i++) {
    sfEls[i].onmouseover=function() {
        this.className+=" hover";
    }
    sfEls[i].onmouseout=function() {
        this.className=this.className.replace(new RegExp(" hover\\b"), "");
    }
}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);

Here is the CSS

#navigation{
    height:32px;
    margin:0 auto;
    width:auto;
}
#navigation ul{
    height:32px;
    line-height:32px;
}
#navigation ul li{
    display:inline;
}
#navigation ul li a,
#navigation ul li a:visited {
    padding:0 20px;
    display:block;
    text-decoration:none;
    float:left;
    color:#1361A5;
    font-weight:bold;
    text-shadow:#ffffff 2px 2px 2px;
}
#navigation ul li a:hover{
    color:#C3C2C1;
}
/* ----------- Sub Menu ----------- */
#sublinks{
    width:auto;
    margin:0 auto;
    background:#C3C2C1;
    height:30px;
    font-size:11px;
    border-radius:8px;
    -moz-border-radius:8px; /* Firefox 3.6 and earlier */
    -webkit-border-radius: 8px;
    -webkit-box-shadow: 0 2px 3px rgba(136, 136, 136, 1); 
    -moz-box-shadow: 0 2px 3px rgba(136, 136, 136, 1); 
    box-shadow: 0 2px 3px rgba(136, 136, 136, 1); 
    behavior: url(http://localhost/landon/assets/pie/PIE.php);
    position: relative;
}
#sublinks ul{
    height:32px;
    line-height:31px;
}
#sublinks ul li{
    display:inline;
}
#sublinks ul li a,
#sublinks ul li a:visited {
    padding:0 10px;
    display:block;
    text-decoration:none;
    float:left;
    color:#FFFFFF;
}
#sublinks ul li a:hover{
    text-decoration:underline;
}
#sublinks li:hover ul{
    display: block;
    position: absolute;
    margin: 0;
    padding: 0;
}
#sublinks li:hover li {
    float: none; 
}
#sublinks li:hover li a {
    background-color: #C3C2C1;
    border-bottom: 1px solid #fff;
    color: #000; 
    left:50;
}
#sublinks li li a:hover {
    background-color: #8db3ff; 
}

/* ----------- Hide Sub menu ----------- */
#s2, #s3, #s2sys, #s2wlan{display:none;}

What I am trying to do is make the second submenu a dropdown from the first submenu and at the moment it displays within the same line and not as a dropdown. How can I do this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T08:02:27+00:00Added an answer on June 11, 2026 at 8:02 am

    http://jsfiddle.net/kVztG/1/

    To make the sub-sub-menu a dropdown change the css below.

    #sublinks li:hover li {
        display:block;
        position:relative;
        top:30px;
    }
    

    The position:relative and top:30px stop the dropdowns from appearing ontop of the sub-menu, and display:block stops the li from display inline.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a menu structure (Drupal) that contains elements representing a menu link. If
I have a main menu screen with a simple ListView that contains links to
i have a menu that contains just one item. Button exit; @Override public boolean
i have a that contains a HORIZONTAL menu. the menu consists of an unordered
I have a C# Windows Form application that contains a menu with this event:
I have a menu that changes and I want to show content in the
I have a menu that contains submenus. Its HTML source looks like this: <ul
I have a menu with a 'Windows' list that contains all mdi children thanks
I have created a user page with a menu that contains a logout button.
suppose we have a menu that two of the items contain a submenu ,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.