Why on Safari the transform translate doesn't work correctly?

前端 未结 3 2062
甜味超标
甜味超标 2020-12-03 07:04

I often use this code to center a div in view:

.centered {
  position: fixed;
  top: 50%;
  left: 50%;
  /* bring your own prefixes */
  transfo         


        
3条回答
  •  春和景丽
    2020-12-03 07:44

    In some cases you'll have to use:

    -webkit-transform: translate3d(-50%,-50%,0);
    

    Sometimes works better with mobile browser.

提交回复
热议问题