disable hover on a parent but not on img child |
disable hover on a parent but not on img child |
Fluflu |
Dec 3 2020, 09:36 AM
Post
#1
|
Group: Members Posts: 1 Joined: 3-December 20 Member No.: 27,667 |
Hi
I have a <img> inside an <a> link. I am trying to disable my cursor changing when it is on <a> but not when it is on <img>. Here is my html code : CODE <a href="#"class="navbar-brand"><img class="search" src="images/search.png"></a> Do you know how I could do that? PS: here is a screen capture of the <a> (delimited by the purple line) This post has been edited by Fluflu: Dec 3 2020, 09:37 AM Attached image(s) |
Christian J |
Dec 3 2020, 01:42 PM
Post
#2
|
. Group: WDG Moderators Posts: 9,661 Joined: 10-August 06 Member No.: 7 |
Since the link only contains an IMG element, how can you see the cursor change over the link but not over IMG? Is it because the link has CSS padding?
|
pandy |
Dec 3 2020, 03:31 PM
Post
#3
|
🌟Computer says no🌟 Group: WDG Moderators Posts: 20,733 Joined: 9-August 06 Member No.: 6 |
Must be.
You need to remove the hand pointer from the link and then add it to the image. Something like so. CODE .nohover { cursor: default } .nohover img { cursor: pointer } HTML <a href="" class="nohover">Blah blah<img src="whatever.jpg"></a> |
Lo-Fi Version | Time is now: 27th April 2024 - 10:08 PM |