How to change an image’s LINK by CSS

Asked

Viewed 608 times

0

I’m editing a site where I only have access to one area to insert CSS. And I have a default image with a link, I was able to change the image using only css, however, I wonder if there is how (even though I know it is totally against the web standards) I modify the link of this image through CSS. Noting that I can only insert CSS lines.

  • How so? You want to change the image if the mouse goes over the area, for example?

  • No no, it’s actually really weird. I can only insert css, and I have an image with href="http://exemplo.com". I was able to change this image using only the css I have access to, but I would like to change this href to href="http://novo.com" using css only as well.

  • 1

    Unfortunately this is impossible, see answer.

1 answer

4

Via CSS you will not be able to pass values to an attribute <a href=""> html. You can only do this through HTML or Javascript.

  • Yeah, I was afraid of that response hahaha

Browser other questions tagged

You are not signed in. Login or sign up in order to post.