Can someone please explain why my link does not work?
<!-- Optional theme this one is ok -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap-theme.min.css" integrity="sha384-fLW2N01lMqjakBkx3l/M9EahuwpSfeNvV63J5ezn3uZzapT0u7EYsXMjQV+0En5r" crossorigin="anonymous">
<button type="button" class="btn btn-primary" href="#">Get your Free Quote now!</button>
HTML buttons cannot have href attribute if they are created using button <button> </button> HTML tags. However, you can use href attribute if you create the buttons using link <a> </a> HTML tags.
Use the . btn-link class in Bootstrap to create a button look like a link.
In HTML, a button link to another page can be by using the <a> tag, <input> tag, and the <form> tag. A link on a button is get by href=”” attribute of <a> tag. The “type=button” and “onclick=link” attributes are used to create a link on the button.
The proper way to do it is use but with class of buttons.
<a href="https://www.google.com" class="btn btn-primary">Get your Free Quote now!</a>
Fiddle Example:
https://jsfiddle.net/aq9Laaew/159899/
You can do the following: It works.
<a href="#"><button type="button" class="btn btn-primary">Get your Free Quote now!</button></a>
The design style of the button remains unchanged.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With