How to have a link that looks like a button with bootstrap

Active May 25, 2018    /    Viewed 20606    /    Comments 0    /    Edit


To get a html link that looks like a button with bootstrap, just add class="btn btn-info" in the balise a:

<a href="" class="btn btn-info">link</a>

Examples by changing info to default or success

How to have a link that looks like a button with bootstrap

Code source

<!DOCTYPE html>
<html lang="en">
<head>

  <title>Bootstrap Example</title>

  <meta charset="utf-8">

  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">

  <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
  <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>

  <style>
  body {
  padding-top: 50px;
  background-color:#FFFFF; 
  }
  </style>

</head>
<body>


<div class="container">

<div class="row">
<div class="col-md-4">

<a href="https://www.w3schools.com/html/html_links.asp">link 1</a>

<br><br>

<a href="https://www.w3schools.com/html/html_links.asp" class="btn btn-info">link 2</a>

<br><br>

<a href="https://www.w3schools.com/html/html_links.asp" class="btn btn-default">link 3</a>

<br><br>

<a href="https://www.w3schools.com/html/html_links.asp" class="btn btn-success">link 3</a>

</div>
</div>
</div>

</body>
</html>

References

Link Source
How to make link look like a button? stackoverflow
buttons bootstrap
link w3schools


Card image cap
profile-image
Daidalos

Hi, I am Ben.

I have developed this web site from scratch with Django to share with everyone my notes. If you have any ideas or suggestions to improve the site, let me know ! (you can contact me using the form in the welcome page). Thanks!



Did you find this content useful ?, If so, please consider donating a tip to the author(s). MoonBooks.org is visited by millions of people each year and it will help us to maintain our servers and create new contents.

Amount