css3 transform 奇葩问题 ?
PHP中文网
PHP中文网 2017-04-17 11:54:22
0
4
446
下面这段代码为什么在androud手机上有些浏览器下(包括微信)(所有.digit-col)的元素移动的距离却不一样!有多有少,甚是奇葩!

$(".digit-col").each(function(index, el) {
       $(el).attr("style","-webkit-transform: translate(0,20px);transform: translate(0,20px)");
});
PHP中文网
PHP中文网

认证高级PHP讲师

reply all(4)
迷茫

Because the set distance is px, different models have different resolutions. The unit pixel size is also different. If you change it to a percentage it should solve the problem

洪涛

Mobile phone resolution problem

小葫芦

If you look at the use of rem units on the mobile terminal, the effect will be the same on different mobile phones

巴扎黑

Thank you for your replies. The problem has been solved because the background image of p only has a width set but not a height!
There are still doubts here-"All p's have the same width and height. The background image only has a width but not a height. Why not?

As a result, the position where the numbers stop after rotating is different (visually different), but in fact the transformation is the same!

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template