How to Create a CSS Button in HTML?

In this article, I will show how to create a impressive button by using a simple css. Create a file button.html and write the below code.

<style>
a, a:active, a:hover, a:visited {
text-decoration: none;
text-decoration-line: none;
text-decoration-style: initial;
text-decoration-color: initial;
}

.mybutton {
border-radius: .25rem;
background-color: #008400;
color: #FFFFFF;
display: block;
margin-bottom: 3rem;
margin-left: auto;
margin-right: auto;
margin-top: 0;
padding: 1rem;
text-align: center;
width: 15rem;
font-family: 'Segoe UI';
font-size: 16px;
}
.mybutton:hover {
background-color: #005100;
transition: background-color 0.35s; }

</style>

some text
<a href="https://www.fastbikri.com/post-ad" class="mybutton">POST AN AD</a>
some text

Add a Comment

Your email address will not be published. Required fields are marked *