开发者

Margin left/right auto and 900px width is positioning with extra wide margin on the iPad/iPhone only

The following profile maintains centering in the main browsers in OSX and WinXp. But is offset to the left in the iPad with the width shorten by the larger margin on the right.

.wrapper {
   width: 900px;
   margin-right: auto;
   margin-left: auto;
   position: relative;
   border: 1px solid #9B9B9B;
 }

<body>
   <div class="wrapper">
     :
   </div>
</body>

I have an inline unordered list containing thumbs that w/o java enabled extends to the right beyond the wrapper. T开发者_JAVA技巧hese images are contained within a div that is positive relative. Once JavaScript is enabled on the browsers, the page is centered.

Again, the problem is only in the iPad and the iPhone.

Is there a possible reason for this?


For mobile devices, all div boundaries must fit within the '.wrapper' with javascript disabled in order for the margin left/right auto to work.

Once javascript executes, theres no problems with moving div's to the far left or right of the wrapper.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜