Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS Vertically Centering Things – Ineffective CSS3 Reply To: Vertically Centering Things – Ineffective CSS3

#204337
Shikkediel
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.