1像素的差距只有在iPad上,但在Safari和Chrome上罚款 [英] A 1 pixel gap only coming on iPad but fine on Safari and Chrome

查看:246
本文介绍了1像素的差距只有在iPad上,但在Safari和Chrome上罚款的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




在过去,WebKit引擎中有一些错误报告为舍入问题:




Here at this line after clouds which will be only visible in iPad or iPhone. Any idea how to solve it?

It's fine in all other desktop browsers.

CSS

#banner-inner { height: 270px;     margin: 0 auto;    position: relative;    width: 954px;}

.cloud-bottom { position: absolute; background: url(images/clouds_dark.png) repeat-x 0 bottom ; z-index: 1; width:100%;height:111px;bottom:0}

.cloud-top { position: absolute; background: url(images/clouds_light.png) repeat-x 0 bottom ; z-index: 4;width:100%;height:111px;bottom:0}

解决方案

This seems to be a bug of the WebKit rendering engine on the iPad, when the page scale factor is less than 1.0. If you keep the page scale factor above 1.0, then the pixel gap does not show up. This can be done with a meta tag:

<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no, width=device-width">

I also found a simple page that demonstrate a similar issue (a rendering glitch on iPad only):

In the past, there have been a number of bugs reported for rounding issues in the WebKit engine:

这篇关于1像素的差距只有在iPad上,但在Safari和Chrome上罚款的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆