0

You read it right.. My html button is functional but sometimes it doesn't redirects to the link.

My button code is

<a href="gallery/"><button style="text-align:center;border:black 1px solid; background-color:black;width:1px;height:1px;border-radius:100px;"><h5 style="color:white;font-family:courier;">Oil Paintings</h5><img src="images/oilPainting.jpeg" width="300px" style="border-radius:1000px;"/></button></a><

I don't know whether this is a button problem or the problem is in the anchor tag somewhere.

To check the working, I added some css the enlarges the button on click. but when I click the button, it just enlarges and doesn't redirects. Please Help..

3
  • Can I nest a <button> element inside an <a> using HTML5? Commented Oct 5, 2020 at 8:57
  • Just style the link as a button instead of overloading the anchor with illegal HTML Commented Oct 5, 2020 at 8:57
  • Okay. one more thing. I tried adding JavaScript in the button using onclick for the redirection.that didn't worked too. Commented Oct 5, 2020 at 8:58

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.