Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

A 1 pixel gap only coming on iPad but fine on Safari and Chrome

Tags:

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.

enter image description here

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} 
like image 656
Jitendra Vyas Avatar asked May 23 '11 14:05

Jitendra Vyas


1 Answers

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):

  • Rounding error with widths

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

  • WebKit Bug #5531
  • WebKit Bug #14956
  • WebKit Bug #18013
like image 57
Laurent Etiemble Avatar answered Sep 27 '22 20:09

Laurent Etiemble