Quote:
Originally Posted by Colmike9
btw just putting <a> around <button> isn't valid HTML5
You can nest <a> around elements except for these:
<a>
<audio> (if the controls attribute is present)
<button>
<details>
<embed>
<iframe>
<img> (if the usemap attribute is present)
<input> (if the type attribute is not in the hidden state)
<keygen>
<label>
<menu> (if the type attribute is in the toolbar state)
<object> (if the usemap attribute is present)
<select>
<textarea>
<video> (if the controls attribute is present)
|
OK cool. But that's more about not putting link tags when you have also added the "onClick script". That creates a conflict. My example removes the conflict.
But why even bother to use a button like that when you can just style the link itself?
<style>
.link {
padding:5px;
font-size:20px;
color:white;
background:blue;
border-radius:7px;
border:solid magenta 1px;
text-decoration:none;
}
.link:hover{
color:yellow;
background:magenta;
box-shadow: 0px 0px 5px 0px #999999;
}
.link:active{
color:darkgreen;
background:yellow;
}
</style>
<br>
<a class="link" href="https://google.com/">Google</a>
