I'm having trouble centering a button on an image using responsive design techniques. I am currently utilizing Bootstrap 3 and have attempted to use CSS margin properties to center the button, but this method is not ideal especially on smaller screens.
Below is my current CSS code:
.gallery-list > li .gallery-thumbnail i{
top: 80px;
color: red;
opacity: 0;
position: absolute;
font-size: 50px;
display:block;
margin-left: 120px;
background-color: transparent;
transition: all 0.3s;
-webkit-transition: all 0.3s;
-moz-transition: all 0.3s;
}
.gallery-list > li:hover .gallery-thumbnail i{
opacity: 1;
transition: all 0.3s;
-webkit-transition: all 0.3s;
-moz-transition: all 0.3s;
}
Display on large screens:
Display on small screens:
My question is, how can I center the button regardless of the device viewport size?