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 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: I use an ArrayCollection object as follows: 1) Number of elements is fixed.
Context: .Net, C# I want to print a complex number made from two doubles.
Context: The structure of the code is that a WCF service (server-size) talks to
I would like to run a str_replace or preg_replace which looks for certain words
context:property-placeholder is a good thing, but I do not want some bean configuration to
Context: Windows7, VBScript, ADODB and ADOX. I have written some VBScript code which creates
Context PHP 5.3.x Overview After doing a code-review with an associate who uses both
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 Let`s say i have: In layout Site.Master: <div class=leftColumn> <asp:ContentPlaceHolder ID=MainContent runat=server />

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.