HTML tutorial
CSS3 tutorial
Bootstrap tutorial
JavaScript tutorial
JQuery tutorial
AngularJS tutorial
React tutorial
NodeJS tutorial
PHP tutorial
Python tutorial
Python3 tutorial
Django tutorial
Linux tutorial
Docker tutorial
Ruby tutorial
Java tutorial
C tutorial
C ++ tutorial
Perl tutorial
JSP tutorial
Lua tutorial
Scala tutorial
Go tutorial
ASP.NET tutorial
C # tutorial
Learn how to style outline buttons with CSS
Step 1) Add HTML:
<button class="btn success">Success</button>
<button class="btn
info">Info</button>
<button class="btn warning">Warning</button>
<button
class="btn danger">Danger</button>
<button class="btn
default">Default</button>
Step 2) Add CSS:
.btn {
border: 2px solid black;
background-color: white;
color: black;
padding: 14px 28px;
font-size: 16px;
cursor: pointer;
}
/* Green */
.success {
border-color: #04AA6D;
color: green;
}
.success:hover {
background-color: #04AA6D;
color: white;
}
/* Blue */
.info {
border-color: #2196F3;
color: dodgerblue
}
.info:hover {
background: #2196F3;
color: white;
}
/*
Orange */
.warning {
border-color: #ff9800;
color: orange;
}
.warning:hover {
background: #ff9800;
color: white;
}
/*
Red */
.danger {
border-color: #f44336;
color: red
}
.danger:hover
{
background: #f44336;
color:
white;
}
/* Gray */
.default
{
border-color: #e7e7e7;
color:
black;
}
.default:hover {
background: #e7e7e7;
}
Try it Yourself »
Add the border-radius
property to create rounded outline buttons:
Go to our CSS Buttons Tutorial to learn more about how to style buttons.