html - Browser rendering right margin iPhone/iPad/webkit -


i have html snippet below renders in browsers. in webkit on iphone , ipad, when pinch page (so smaller), see black border background color of body shining through on right edge. happens when specifiy width of .headerpic div. since place in document specify width, wondering why stops short of rendering way right edge (since theoretically widest part of document?).

i've attached photo of looks ipad.

<!doctype html> <html>     <head>      <style>       body {background-color:#000;color:#231f20;margin:0;}       #wrapper {background-color:#fff;min-height:1000px;}       #header .headerpic {height:102px;padding-top:80px;margin:0 auto;width:986px;}       #footer {color:#fff;}     </style>   </head>    <body>      <div id="wrapper">       <div id="header">         <div class="headerpic">         </div>       </div>     </div>      <div id="footer">     </div>    </body> </html> 

photo of problem

it illustrate problem little bit clear: http://jsbin.com/ilenu5/5

what did:

  1. i increased width of #headerpic 1286px
  2. i added background color of #headerpic, red

so actual problem is: overflow occured

why? because don't set viewport (width=device-width) , minimum physical width (in px or cm or em) of body, body width default 980px, , inherited #wrapper-- 986px #headerpic overflows #wrapper, , makes black background appear. since overflowed area width small (986-980=6px), see black line.


Comments

Popular posts from this blog

c# - How to set Z index when using WPF DrawingContext? -

razor - Is this a bug in WebMatrix PageData? -

visual c++ - Using relative values in array sorting ( asm ) -