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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T16:53:07+00:00 2026-05-30T16:53:07+00:00

Context I’ve <li><div></div></li> elements with a background color on hover. It looks like :

  • 0

Context

I’ve <li><div></div></li> elements with a background color on hover.

It looks like :

enter image description here

I want to color the full line, like :

enter image description here

Investigation

The code:

div.wrapper:hover {
  background: rgba(220, 220, 220, 0.3);
}

I tried this, without success:

div.wrapper:hover:before {
  content: "";
  position: absolute;
  width: 100%;
  height: 0;
  top: 0;
  right: 0;
  background: rgba(220, 220, 220, 0.3);
}

Question

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-05-30T16:53:08+00:00Added an answer on May 30, 2026 at 4:53 pm

    Remove all margins from your ul/li, set your content wrappers to display:block, and then put padding on those elements based on the nesting level: http://jsfiddle.net/dYdQB/

    HTML

    <ul>
      <li><span>Hello</span></li>
      <li><span>World</span><ul>
        <li><span>Nested deeper</span></li>
        <li><span>And again</span><ul>
          <li><span>And Even Deeper</span></li>
        </ul></li>
      </ul></li>
    </ul>
    ​
    

    CSS

    ul, li { margin:0; padding:0 }
    ul li span { display:block }
    ul li span:hover { background:orange }
    li span       { padding-left:2em }
    li li span    { padding-left:4em }
    li li li span { padding-left:6em }​
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Context PHP 5.3.x Overview After doing a code-review with an associate who uses both
Context: The structure of the code is that a WCF service (server-size) talks to
Context I want to make this call via reflection instanceOfEventPublisher.Publish<T>(T eventInst); When I call
Context: Trying to link a tab to a specific content div on a html
Context: .Net 3.5, C# I'd like to have caching mechanism in my Console application.
CONTEXT I have a list of items (or arbitrary length). I'd like to group
Context: Windows7, VBScript, ADODB and ADOX. I have written some VBScript code which creates
Context: I downloaded a file (Audirvana 0.7.1.zip) from code.google to my Macbook Pro (Mac
Context I would like to integrate [MediaWiki][1] as a helping tool to my system.
Context Say, we want to use the Box-Muller algorithm. Starting from a couple of

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.