<div class="container">
<button class="btn btn1">Click Me!</button>
<button class="btn btn2">Click Me!</button>
<button class="btn btn3">Click Me!</button>
</div>
.container {
width: min(70vw, 50rem);
margin: 3rem auto;
padding: 3em;
background: white;
display: grid;
gap: 2rem;
grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
place-items: center;
}
.btn {
display: inline-block;
cursor: pointer;
text-decoration: none;
font-size: inherit;
border: 0;
line-height: 1;
background: none;
padding: .75em 1.5em;
transition: outline-offset 0.2s ease;
}
.btn1 {
color: #6c5ce7;
outline: 2px solid #6c5ce7;
border: 2px solid #6c5ce7;
outline-offset: -2px;
}
.btn1:hover,
.btn1:focus {
outline: 2px solid #6c5ce7;
outline-offset: 2px;
}
.btn2 {
color: #d63031;
outline: 2px solid #d63031;
border: 2px solid #d63031;
outline-offset: -2px;
}
.btn2:hover,
.btn2:focus {
outline: 2px solid #d63031;
outline-offset: -7px;
}
.btn3 {
color: #00b894;
outline: 2px solid #00b894;
border: 2px solid #00b894;
outline-offset: -2px;
transition: outline-width 200ms ease, outline-offset 200ms ease;
}
.btn3:hover,
.btn3:focus {
outline: 2px solid #00b894;
outline-width: 9px;
outline-offset: -9px;
}
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.