I was using a Scaffold
library for automatic generation of HTML codes. It was specifically for generating forms in Boostrap 3.
Then I noticed that the action links that were being generated were like this:
<a href="url_da_pagina">
<button class="btn btn-primary"></button>
</a>
It seems that the Scaffold of that library was generating the code of Anchor
(The famous Link) with a Button
inside just for the Link formatting to be equal to the button.
But you do not need to, in bootstrap you can use this way:
<a href="" class="btn btn-primary">Tipo como se fosse um botão</a>
The question that came to me is: The automatic code generation library did this as if it were "something normal". Is it really "normal"?
Is there a problem with using Button
within A
, or vice versa?
I do not know, but institively (no one told me anything or no article I read taught me this), I have a small impression that this is a bad practice (or gambiarra).
Is this valid? These html code validators of life would approve putting a button within a link?