Answer the question
In order to leave comments, you need to log in
How to center an icon in the middle of a button?
The question is simple, but how to properly center the icon inside the button. The slick-slider's slide toggle button
<button class="slider-button slider-button__prev feedback-slider__button">
<i class="fas fa-chevron-left"></i>
</button>
.slider-button
position: absolute
display: block
margin: 0 auto
padding: 0
width: 63px
height: 63px
top: 50%
transform: translateY(-50%)
font-size: 20px
color: $text-color-dark
border-radius: 100%
border: 1px solid red
box-shadow: -5px 5px 11px rgba(83, 83, 83, 0.16)
background: #ffffff
transition: all 0.5s ease
z-index: 2
cursor: pointer
&:hover
background: $active-color
&__prev
left: -30px
position: absolute
display: flex!important
align-items: center
justify-content: center
padding: 0
width: 63px
height: 63px
top: 50%
transform: translateY(-50%)
font-size: 20px
color: $text-color-dark
border-radius: 100%
border: 1px solid red
box-shadow: -5px 5px 11px rgba(83, 83, 83, 0.16)
background: #ffffff
transition: all 0.5s ease
z-index: 2
cursor: pointer
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question