Struggling to center a button within my div, despite having all other content centered.
Here is my code:
.middle {
width: 100%;
height: auto;
text-align: center;
position: relative;
}
.middle section {
padding: 18vh 6%;
line-height: 0.5;
color: #EE6352;
font-weight: 400;
font-size: calc(16px + 3vw);
}
...
<a id="middle">
<div class="middle">
...
After some research, I added the following to the .upbutton class to center it:
margin:0;
-ms-transform: translateX(-50%);
transform: translateX(-50%);
It worked for centering the button initially, but when hovered over, it lost its center alignment. Can anyone clarify why this happened and provide guidance? Much appreciated!