Home › Forums › CSS › Vertically Centering Things – Ineffective CSS3 › Reply To: Vertically Centering Things – Ineffective CSS3
June 28, 2015 at 8:02 pm
#204337
Participant
The second transform is overwriting the first one, for them to both work they would have to be combined into a single rule :
.center {
position: absolute;
margin-top: 0;
left: 50%;
top: 50%;
-webkit-transform: translate(-50%,-50%);
transform: translate(-50%,-50%);
}
Only the webkit browser prefixes is needed by the way.