Scaling problem with -webkit-transform with mobile safari on iPad

后端 未结 2 987
后悔当初
后悔当初 2021-02-10 10:16

In the HTML page below, I am scaling a block with a -webkit-transform. The transform scales the block from its initial size to its double size.

This works a

2条回答
  •  南笙
    南笙 (楼主)
    2021-02-10 10:32

    I managed to solve the problem myself.

    The solution is simple: just make sure the element is scaled to its original size to begin with:

    -webkit-transform: scale(1);
    

    There is one trick to it, though. If you, like I below, add a class to an element selected by #id, the #id has higher priority than the class and it will not show unless you tell the browser that it is important

    -webkit-transform: scale(2) !important;
    

    An alternative way to solve this is to not select the element by #id but by class (.block) or by element (div). Anything with lower priority than an id.

    Solution follows:

    
    
    
    
      
    The Block

提交回复
热议问题