<a href="https://css-tricks.com" class="btn">
<span class="btn__text">Standard button</span>
</a>
<a href="https://css-tricks.com" class="btn btn--orange btn--big">
<span class="btn__price">$3</span>
<span class="btn__text">Big button</span>
</a>
<a href="https://css-tricks.com" class="btn btn--blue btn--big">
<span class="btn__price">$4</span>
<span class="btn__text">Big button</span>
</a>
<a href="https://css-tricks.com" class="btn btn--green btn--big">
<span class="btn__price">$9</span>
<span class="btn__text">Big button</span>
</a>
/* Block */
.btn {
text-decoration: none;
background-color: white;
color: #888;
border-radius: 5px;
display: inline-block;
margin: 10px;
font-size: 18px;
text-transform: uppercase;
font-weight: 600;
padding: 10px 5px;
}
/* Element */
.btn__price {
background-color: white;
color: #fff;
padding-right: 12px;
padding-left: 12px;
margin-right: -10px; /* realign button text padding */
font-weight: 600;
background-color: #333;
opacity: .4;
border-radius: 5px 0 0 5px;
}
/* Element */
.btn__text {
padding: 0 10px;
border-radius: 0 5px 5px 0;
}
/* Modifier */
.btn--big {
font-size: 28px;
padding: 10px;
font-weight: 400;
}
/* Modifier */
.btn--blue {
border-color: #0074D9;
color: white;
background-color: #0074D9;
}
/* Modifier */
.btn--orange {
border-color: #FF4136;
color: white;
background-color: #FF4136;
}
/* Modifier */
.btn--green {
border-color: #3D9970;
color: white;
background-color: #3D9970;
}
body {
font-family: "fira-sans-2", sans-serif;
background-color: #ccc;
}
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.