-1

Tell me how to add href to a link via CSS. How to do it in the standard way is clear.

<div>
<a href="example.com">Button</a>
</div>

But I need pure HTML. And in CSS, specify which address to make the transition to.

<div>
<a class="button-click"></a>
</div>


.button-click a {href:"https://example.com"}

How do I specify a path in CSS?

  • 2
    you can't use CSS here but with js or jq you can handle it perfectly! – mkafiyan Jul 27 '20 at 11:47
  • 1
    Does this answer your question? [Changing the href of an html tag with css](https://stackoverflow.com/questions/15356717/changing-the-href-of-an-html-tag-with-css) – ventiseis Jul 27 '20 at 20:11

1 Answers1

2

CSS cannot be used to perform action or make changes to DOM. Its used for presentation purpose. You can use script to do the manipulation not css.

Tejeshree
  • 674
  • 3
  • 8