I have a link like:
HTML:
<a href="#" title=""> <img src="stack.png" alt="" title="" /> stackoverflow </a>
CSS:
a { text-decoration: underline}
I want to remove the underline from the image.
I tried:
a img {text-decoration:none}
But it not works.
BS:
I can do that if I added a display:block to img but that can cause a damage for the rest of the site, also I won’t add a specific class for this section.
Could I do that with jQuery?
You should do this with CSS.
You could add an inline style to that link:
Or you could add a class to that link:
EDIT:
If you cannot alter the
html, then use jQuery:(This is similar to what is above, but targets the parent of the
img— that is thea— and then changes the style appropriately.)Fiddle http://jsfiddle.net/jasongennaro/vM55K/
EDIT 2:
If that is the only
childelement in ana, you could use this:Fiddle http://jsfiddle.net/jasongennaro/vM55K/1/