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 8971669
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T18:00:57+00:00 2026-06-15T18:00:57+00:00

I am creating a vertical dropdown menu for a webpage. when i hover over

  • 0

I am creating a vertical dropdown menu for a webpage. when i hover over the link, it works fine and changes color as specified. but as I move towards the right on li’s having sub level lists(“some text b” and “c” in the code), it goes back to its original color.
how do I solve this problem?

HTML markup:

<div id="vertical-menu">
    <ul class="top-level">
        <li><a href="#">Some text A</a></li>
        <li>
            <a href="#">Some text B</a>
            <ul class="sub-level">
                <li><a href="#">RSVP</a></li>
                <li><a href="#">Organizing Team</a></li>
            </ul>
        </li>
        <li>
            <a href="#">Some text C</a>
            <ul class="sub-level">
                <li><a href="#">Events</a></li>
                <li><a href="#">Reunions</a></li>
            </ul>
        </li>
    </ul>
</div>​

CSS style:

#vertical-menu {
    padding: 10px 0;
    margin: 0 -14px;
    width: 250px;
}
#vertical-menu li {
    list-style: none;
    position:relative;
}
#vertical-menu a {
    padding: 10px;
    margin-right: 0;
    display: block;
    background: -webkit-gradient(linear, left top, left bottom, from(#CD0000),           to(#8B0000));
    color: #FFFFFF;
    font-size: 1.05em;
}
#vertical-menu a:hover {
    background: url("Wood Texture 2.jpg") 100% 100%;
    color: #8B0000;
}
ul.sub-level {
    display:none;
    position:absolute;
    left:171px;
    top: 0;
}
.sub-level a {
    width: 200px;
}
li:hover .sub-level {display: block;}

To see a demo on jsfiddle: http://jsfiddle.net/fFzeS/

  • 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-15T18:00:59+00:00Added an answer on June 15, 2026 at 6:00 pm

    Use #vertical-menu li:hover > a instead of #vertical-menu a:hover (demo)

    Edit:

    Your real problem here is that the submenu overlaps the base menu – you need to remove the padding/margin from your ULs:

    .vertical-menu ul { margin: 0; padding: 0; }
    

    and adjust the left:171px; to left:250px;

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

Sidebar

Related Questions

I'm creating a staticbox and a staticboxsizer in a vertical sizer. Everything works fine
I had been racking my brains over creating a vertical alignment in css using
I am creating a system tray program with a shortcut/context menu, but I can't
I've got a question about creating a vertical image sprite menu. Here's my HTML:
I am using JQueryUI Accordion for creating a Vertical Multi-level Menu with the following
I'm creating a dynamically generated PDF using FPDF. My PDF requires many exactly horizontal/vertical
I'm essentially creating a vertical breadcrumb to create a website navigation for a mobile
SO, I'm creating a vertical slider based on the Coda Slider . Although my
I have a vertical menu using lists (li) and I've got it changing background
I am creating a vertical navigation and have already made the CSS properties for

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.