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

Ignore mouseover of text centered over image inside div

I have text centered over an image inside of a div.

<div class="row">
   <div class="col-md-4"><img src="dog.jpg" class="panel"><div class="panel-text">ONE ONE ONE</div></div>
   <div class="col-md-4"><img src="dog.jpg" class="panel"><div class="panel-text">TWO TWO TWO</div></div>
   <div class="col-md-4"><img src="dog.jpg" class="panel"><div class="panel-text">THREE THREE</div></div>
</div>
           

When the image is mouseover’d, the image is enlarged with CSS transform: scale(1.2)

.panel:hover {
    transform: scale(1.2);
}

My problem is, if the text inside the div (centered over image) is mouseover’d, the .panel:hover is ignored and goes back to normal state. How can I ignore/disable the text in case the text is mouseover’d and keep transform: scale(1.2); active?

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

Live demo here https://vendbits.com/wp_gpl/

Thanks in advance.

>Solution :

you can add pointer-events: none; to the text

.panel-text{
   pointer-events: none;
}
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