0

Encapsulate a text and an image tag as a single link

In the following code, I have created a card in which there are a text and an image. I want to make the whole card as a clickable link. I have put anchor (a) tag around the card(div) but it makes the image and text appear as a link(as it changes color and underlined). I want to make the whole card appear as a link and not it's individual elements. https://code.sololearn.com/WcH0HOn38SZy/?ref=app

4th Jan 2020, 7:55 AM
harshit
harshit - avatar
1 Answer
+ 1
If fact the whole card is a link. If you don't want the color of the text to change you can specify that in your CSS. By default browsers will print text that inherits from an anchor tag as link unless you tell it to do something else.
4th Jan 2020, 8:44 AM
Aaron Eberhardt
Aaron Eberhardt - avatar