-1

On https://bm-translations.de/dolmetscher-franzoesisch-deutsch.php you can see the buttons are not working and I don't 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?

Nisse Engström
  • 4,738
  • 23
  • 27
  • 42
Krystian
  • 887
  • 5
  • 21
  • 52
  • 4
    A `button` can't contain an `a`. The content model for a `button` forbids interactive content https://www.w3.org/TR/2011/WD-html5-20110525/the-button-element.html here are some ways to make buttons behave like links https://stackoverflow.com/questions/2906582/how-to-create-an-html-button-that-acts-like-a-link – Michael Coker Aug 23 '17 at 00:16
  • 5
    The big round red button?...it's working on Chrome – Hackerman Aug 23 '17 at 00:16
  • @Hackerman in chrome its working after a few seconds but its not working in firefox. This is quite strange. Propably I should style the – Krystian Aug 23 '17 at 00:20

1 Answers1

2

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

3066d0
  • 1,853
  • 1
  • 14
  • 18