Reputation: 6295
What I am trying to do is fix a caption over an image, using the following approach. For some reason either transform or translate with percentage is not working on my Android devices.
It works fine on my desktop browser though. How can I fix this?
CSS
.city-caption h2
{
font-weight: 800;
color: white;
text-transform: uppercase;
margin: 0;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
webkit-transform: translate(-50%, -50%);
}
Upvotes: 1
Views: 6645
Reputation: 1251
the correct sintax is :
-webkit-transform: translate(-50%, -50%);
Note the "-" before "webkit-transform"
Hope it helps
Upvotes: 6