1

I have a div with a display of 'none'. I want this div to display after I hover over its sibling element for 1 second> I am currently using the transition-delay property in CSS but it doesn't seem to work when using the adjacent sibling selector. Here is my current code:

HTML

<i id="pass" style="font-size: 30px; width: 50px" class="fa fa-users fa-3" aria-hidden="true"></i>
<div class="speech-bubble" id="pass_hover">
     <h1>2+ Passenger Seating</h1>
</div>

CSS

.speech-bubble {
        display: none;
    }

#pass:hover + #pass_hover {
        transition-delay:1s;
        display: block;
    }

1 Answers1

0

Try something like this

<i id="pass" style="font-size: 30px; width: 50px" class="fa fa-users fa-3" aria-hidden="true"></i>
<div class="speech-bubble" id="pass_hover">
     <h1>2+ Passenger Seating</h1>
</div>

.speech-bubble:after {
        height :0;
    }

#pass + #pass_hover {
        transition: all 1s;
        transition-delay:.1s;
        height: 0;
        width: 0;
        opacity:0;
    }
#pass:hover + #pass_hover {
        transition-delay:.1s;
        display: block;
        height: 100%;
        width:100%;
        opacity : 1;
    }
Nandita Sharma
  • 13,287
  • 2
  • 22
  • 35