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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T22:04:58+00:00 2026-05-23T22:04:58+00:00

I have a vertical ul as a nav menu. When a:hover is triggered, a

  • 0

I have a vertical ul as a nav menu. When a:hover is triggered, a border-left shows up at the edge of the screen and padding is adjusted so the text isn’t displaced. Pretty common menu effect. Works well, except when user resizes their screen to the point where the nav menu items break into two lines- then there is no padding on the second line, pulling it to the left. I need to find a way to apply the padding equally to the whole li even if the line is broken, while keeping my border-left effect!

I have looked at some answers to similar problems on stackoverflow but they all seem to involve removing the padding from the li and applying it to the ul or containing element instead. If I do this, then I lose the positioning on my left border highlight- the border shows up right next to the text, and I can’t figure out how to manipulate the padding on the border separate from the li to bump it back out!

Here’s the css:

#middle_left ul {
    list-style: none;
    padding-top:5%;
    font-family: 'Gill Sans', Verdana, Arial, 'Liberation Sans', FreeSans, sans-serif;
    font-size:1.5em;
}

#middle_left ul a {
    padding-left:15px;
    text-decoration: none;
    color: #2e2f2a;
}

#middle_left ul a:hover {
    padding-left:12px;
    color: #81827f;
    border-left: solid 3px #81827f;
}

And the HTML:

<div id="middle_left">
    <ul>
        <li><a href="#">The Novel</a></li>
        <li><a href="#">Bio</a></li>
        <li><a href="#">Translation</a></li>
        <li><a href="#">Other Works</a></li>
    </ul>
</div> 

Thanks for any suggestions for how to tackle 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-05-23T22:04:59+00:00Added an answer on May 23, 2026 at 10:04 pm

    Wrap the a in divs:

    <div id="middle_left">
    <ul>
        <li><div><a href="#">The Novel</a></div></li>
        <li><div><a href="#">Bio</a></div></li>
        <li><div><a href="#">Translation</a></div></li>
        <li><div><a href="#">Other Works</a></div></li>
        </ul>
    </div>
    
        #middle_left ul {
    list-style: none;
    padding-top:5%;
        padding-left: 15px;
    font-family: 'Gill Sans', Verdana, Arial, 'Liberation Sans', FreeSans, sans-serif;
    font-size:1.5em;
    }
    
    #middle_left ul div{
        padding-left:15px;
        text-indent: -15px;
    
    }
    
    #middle_left ul div:hover{
        padding-left:15px;
        text-indent: -15px;
        border-left: solid 3px #81827f;
    
    }
    
    #middle_left ul a {
    padding-left:15px;
    text-decoration: none;
    color: #2e2f2a;
    }
    
    #middle_left ul a:hover {
    padding-left:12px;
    color: #81827f;
    }
    

    See here for example:

    http://jsfiddle.net/6nz9F/2/

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

Sidebar

Related Questions

I'm having a Javascript conflict. I have a vertical javascript left nav menu and
I have a vertical nav menu that is made up of nested lists, however
I have a vertical menu in my system which is basically made of HTML
I have a UIScrollView that shows vertical data, but where the horizontal component is
So I have a fairly simple vertical CSS menu based off of UL. <ul
I have a vertical image gallery of this sort: <div class=image-container> <div class=nav> <div
I have a wrapper, then ul, then li with padding and left float. In
I have a problem with a vertical css menu with 3-level submenus.The last submenu
I have a complex vertical nav which includes transparent PNG's in my design. I
I have vertical submenu as under: <div id=dropdown_menu class=menu> <ul> <li> <a>First Link</a></li> <li>

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.