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

  • SEARCH
  • Home
  • 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 685133
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T01:53:29+00:00 2026-05-14T01:53:29+00:00

I have been trying to make the sub-menu horizontal. In my HTML it looks

  • 0

I have been trying to make the sub-menu horizontal.

In my HTML it looks like this:

<ul id="nav">
    <li><a href="#">Home</a></li>
    <li><a href="#" class="selected">About Us</a>
        <!-- I want to make this horizontal -->
        <ul id="subnav">
            <li><a href="#">Item 01</a></li>
            <li><a href="#" class="selected">Item 02</a></li>
            <li id="nav_last"><a href="#">Item 03</a></li>
        </ul>
        <!-- End here -->
    </li>
 </ul>

My CSS for the List is like this:

/* remove the list style */
#nav {
    margin:0; 
    padding:0; 
    list-style:none;
}   

/* make the LI display inline */
/* it's position relative so that position absolute */
/* can be used in submenu */
#nav li {
    float:left; 
    display:block; 
    width:100px; 
    background:#d90000; 
    position:relative;
    z-index:500; 
    margin:0 1px;
}

/* this is the parent menu */
#nav li a {
    display:block; 
    /*padding:8px 5px 0 5px; */
    padding-top: 11px;
    font-weight:normal;  
    height:30px; 
    text-decoration:none; 
    text-align:center; 
    color:#f8e2e2;
}

#nav li a:hover {
    color:#f8e2e2;
    background-color: #bf0000;
    border-left: 1px solid #a50000;
    border-right: 1px solid #a50000;
}

#subnav {
    position:absolute; 
    left:0; 
    display:none; 
    margin: 0 0 0 0;
    padding:12px 0 0 0; 
    list-style:none;
    background-image: url('../images/arrow_down.png');
    background-repeat: no-repeat;
}

#subnav li{
    font-size: 0.9em;

    border-top:1px solid #a50000;
    border-left:1px solid #a50000;
    border-right:1px solid #a50000;

    position:relative;
    width:98px; 
    display:block; 
    float:left;
}

And I am using jQuery to show/hide the sub-List. My problem is that the sub-menu is not horizontal. What changes do I need to make on my CSS for the sub-menu to become horizontal? I have spent hours without any success.

Thanks so much!

  • 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-05-14T01:53:30+00:00Added an answer on May 14, 2026 at 1:53 am

    Set a wide width on #subnav, e.g.

    #subnav {
        width: 600px;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been trying to make this to be a little jQuery plugin that
So I recently have been trying to incorporate more sub forms to make the
I have been trying to make a case for using Python at my work.
I have been trying to make a div fade in evey 30sec and out
I have been trying to make an init script using start-stop-daemon. I am stuck
I have been trying to make a Cross-platform 2D Online Game, and my maps
I have been trying to test my application to make sure that all the
I have been trying to get yui-css grid system to make a three column
I have been trying to make a secure login for my site that I
So I have been given a C program, which I am trying to make

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.