Krystian Manthey Krystian Manthey - 30 days ago 7
CSS Question

Button doesnt link to other page

On https://bm-translations.de/dolmetscher-franzoesisch-deutsch.php you can see the buttons are not working and I dont know why.

Structure is like that:

<button>
<a href="https://bm-translations.de/#kontakt" target="_blank">Click here</a>
</button>


What am I doing wrong?

Answer Source

Since the a tag is inside the button, the clickable padding area isn't part of the link. What you could do instead is invert the structure so that the a is the parent of the button.

<a href='#'>
  <button type='button'>
    Contact
  </button>
</a>

Example: https://jsfiddle.net/hh6eu4kL/

Tested: Edge / Firefox / Chrome