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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T05:38:05+00:00 2026-06-13T05:38:05+00:00

I have two child elements which I set as hidden by default. .child1, .child2{

  • 0

I have two child elements which I set as hidden by default.

.child1, .child2{
visibility:hidden;
}

#parent :hover .child1, #parent:hover .child2{
visibility:visible;
}

As you can see, whenever I hover the parent, the children become visible. So far so easy.

Now here’s the tricky part: When I hover over one of the children, I’d like all the other children to become hidden again. So when I hover over child1, child2 should not be visible anymore. I want to ‘undo’ the hovering of the parent, so to speak, and only leave the child visible over which I am hovering.

How do I override or undo the parent:hover ?

Edit:
I found this, which is going in the right direction:

#parent:hover > .child1:hover{
    do something;
}

Basically, when both the parent AND child1 are hovered, then the style applies to child1. This is what I’m looking for, but now the problem is, how do I apply the style to child2 instead of child1?

Edit2:
Another idea would be to use something like this:

#parent:hover >.children:not(.child1){
    do something;
}

This selects all children of the parent which are not child1 and applies the style to them. And again, a problem: This is only triggered when hovering the parent alone. How can I trigger this exact same effect when the parent AND child1 are hovered?

  • 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-13T05:38:06+00:00Added an answer on June 13, 2026 at 5:38 am

    Okay, since there didn’t seem to be a proper way to do exactly what I wanted, I used a bit of a work-around and solved it using the opacity:

    .child1, .child2{ 
        opacity:0; 
    }
    
    #parent:hover .child1, 
    #parent:hover .child2{ 
        opacity:0.6; 
    }
    
    #parent:hover > .child1:hover,
    #parent:hover > .child2:hover{
        opacity:1; 
    }
    

    So basically, when I hover the parent alone, all children are ‘semi-transparent’, and when I hover the parent AND a child, that child becomes fully visible. It’s a bit different than the original idea, but it turned out okay.

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

Sidebar

Related Questions

I have two divs like so <div id=parent style=width:100px:overflow:hidden;> <div id=child> tooooooooooooooooooooo much content
I have two elements which can vary in heights and both floated next to
I have two object : Mother and Child. Mother have many Children, How can
I have a table with two child tables. For each record in the parent
I have two validation groups: parent and child I have an add button that
I have two tables a parent and a child table. The child table has
I have two tables Loan(Parent Table) and Receipt(Child table)what i want to do is
i have two Entities, Parent and Child, that are linked through a bidirectional one-to-many
I have two entities types: RunContainer parent entity type Run child entity type Run
I got three elements defined in a dtd which have the same child element

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.