I'm having trouble creating an overlay style for a Bootstrap button.
I have the following button code:
<button id="btnTest" class="btn btn-primary">
<span class="fa fa-certificate"></span>
Test
<div class="btn-overlay">
<i class="fa fa-refresh fa-spin"></i>
</div>
</button>
That's the layout of the button I'd like and I've implemented the following CSS:
.btn-overlay {
position: absolute;
padding: 0;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: #ffffff;
opacity: 0.5;
transition: opacity .5s;
}
This make the overlay cover the entire container div (not sure how that's happening) and not just overlaying the entire button.
Any idea what I'm doing wrong here? Once I get the overlay part I'll worry about centering the fa-refresh
icon.