You have unnecessarily wrapped each of your <button>
s in an <a>
tag and this is the browser’s default underline style of the <a>
tag that you can see.
Note: Some of the other answers suggest simply hiding the underline, but wrapping a <button>
in an <a>
is considered to be an anti-pattern that should be avoided.
Links
.btn1 {
font-family: 'Times New Roman', Times, serif;
margin-right: 0px;
width: 100px;
height: 30px;
font-size: 17px;
font-weight: 200;
background-color: #f7e7e7;
color: rgb(49, 126, 126);
border-radius: 5px;
border: 1px solid rgb(186, 230, 173);
box-shadow: 3px 3px rgb(98, 151, 98);
text-decoration: none;
}
<div>
<a class="btn1" href="#">Home</a>
<a class="btn1" href="product.html">Products</a>
<a class="btn1" href="#">Buy Now</a>
<a class="btn1" href="findus.html">Find us</a>
</div>
Buttons
.btn1 {
font-family: 'Times New Roman', Times, serif;
margin-right: 0px;
width: 100px;
height: 30px;
font-size: 17px;
font-weight: 200;
background-color: #f7e7e7;
color: rgb(49, 126, 126);
border-radius: 5px;
border: 1px solid rgb(186, 230, 173);
box-shadow: 3px 3px rgb(98, 151, 98);
}
<div>
<button class="btn1">Home</button>
<button class="btn2">Products</button>
<button class="btn3">Buy Now</button>
<button class="btn4">Find us</button>
</div>
You can read about links vs buttons, and why you might choose one over the other here.