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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T01:04:20+00:00 2026-05-28T01:04:20+00:00

I have divs inside li elements: <ul id=tabs> <li id=tab-1> <div id=xxx></div> </li> ….

  • 0

I have divs inside li elements:

<ul id="tabs">   
    <li id="tab-1"> <div id="xxx"></div> </li>
    ....
</ul>

If in CSS I apply hover effect over li element

#tabs li:hover {....}

The effect is, as expected, applied on li and child div,

however if I make one space in between li and colon

#tabs li :hover {....}

effect applies only to child div

Is this normal? I’m a scripting beginner, and by reading different tutorials I got impression that white space does not make difference when script is executed. I tested this in Chrome, Safari and Firefox

  • 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-28T01:04:21+00:00Added an answer on May 28, 2026 at 1:04 am

    #tabs li :hover {....} = #tabs li *:hover {....} (* = universal selector).

    A space separates sub-selectors. This makes sense when you’re concatenating multiple selectors:

    Say, you want to select a <div class="foo">, but not <a class="foo"> or <div>. The correct selector would be div.foo (element <div> with class foo).

    If you add a space before the dot, you would be selecting a element with class foo, which is a child of <div>.

    Back to your situation.

    <div id="tabs">   #tabs                 #tabs
        <li>          li:hover              li
            <div>     div                   *:hover
                    = #tabs li:hover div  = #tabs li *:hover
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to have 3 divs aligned inside a container div, something like this:
I have a div with two nested divs inside, the (float:left) one is the
I have a Div with five float divs inside: var div=document.createElement(div); div.className=cssDivNino; var divFolio=document.createElement(div);
Suppose I have an div. Inside this div, I have two divs floating left,
I have a div (main div) which contains several div elements(sub divs). I want
I have an ASP.NET repeater, which contains 3 divs inside the ItemTemplate. Each div,
I have a series of DIV elements with more DIV elements inside of them,
I have several DIVs on a page. Inside these DIVs I have several form-elements
I have a container div, and numerous elements inside of it (i.e. spans, img,
I have an image that is wrapped inside a couple of DIV elements <div

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.