Member-only story

Create Side By Side HTML Buttons

Marika Lam
Jan 11, 2022

--

Here is how to create a button group of side by side Approve and Reject buttons.

  1. Here is the HTML
<div class="btn-group">
<button>Approve</button>
<button>Reject</button>
</div>

2. Here is the CSS

.btn-group button {
border: 1px;
color: white;
padding: 10px 24px;
cursor: pointer;
float: left;
width: 100px
}
.btn-approve {
background-color: #04AA6D;
}
.btn-reject {
background-color: #FF0000;
}
.btn-reject:hover {
background-color: #c30b0b;
}
.btn-approve:hover {
background-color: #3e8e41;
}
.btn-group:after {
content: "";
clear: both;
display: table;
}
.btn-group button:not(:last-child) {
border-right: none;
}

--

--

No responses yet