Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

A hover on top of a hover

I already have a css hover where when hovering over someones name, a card to the side appears with more information about that user.

Is it possible to have another hover on top of the first hover? So another card appears with even more information.

Name (hover on name) > d.o.b, address , etc (hover on their d.o.b for example) > second card appears with further info.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

Thanks,

Jack

At the moment I just have the initial as a radio button which brings up the first info card, then I have a hover based off of that to show the second info card.

>Solution :

.parent {
  width: 100px;
  height: 100px;
  background-color: lightpink;
}

.child,
.sub-child {
  display: none;
  width: 100px;
  height: 100px;
  position: relative;
  right: -100px;
}

.child {
  background-color: lightgreen;
}

.sub-child {
  background-color: lightblue;
}

/* Show the child when hovering on the parent */
.parent:hover .child {
  display: block;
}

/* Show the sub-child when hovering on the child */
.child:hover .sub-child {
  display: block;
}

/* Not needed, just styling */ 
div:hover {
  outline: 2px solid red;
}
<div class="parent">
  <div class="child">
    <div class="sub-child"></div>
  </div>
</div>
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading