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. These images are contained within a div that is positive relative. Once


Related to : Margin left/right auto and 900px width is positioning with extra wide margin on the iPad/iPhone only
margin: auto plus margin-left: offset? (css)
Programming Languages

I have #container {margin: 0 auto;} on my test site Than I added the left vertical menu and on some small screens that menu is not fully visible. Like my old laptop :-)


I want to keep the margin: auto setting in place but I want to move the whole #container little bit right. Could it be done some how? #container {margin-left:10px;} doesn't work ...


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

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. These images are contained within a div that is positive relative. Once

positioning elements left and right of a div with margin:auto
Programming Languages

I have a div with a set width (in pixels) that is centered by margin: auto;. How can I position an element to the left or right of this div, with a width that is dynamically adjusting to however wide the margin of the center div is?


Thanks for your help!


Edit: more info...


basically, it's the following setup:


<div></div>
<div style="margin:auto; width: 950px">content goes here</div>
<div></div>

I want to have the same background image on the left and right of the center div, but a different one in the center div. So h

CALayer resizing with flexible width, left margin and right margin
Programming Languages

I added a sublayer to an existing layer and set its autoresizing mask to the following:


sublayer.autoresizingMask = kCALayerWidthSizable | kCALayerMaxXMargin | kCALayerMinXMargin;

Resizing works OK when making the layer bigger -- but making it smaller never changes the width.
This picture illustrates the problem:



Anybody seen this before? How to achieve what's in point 4 in the picture? Thanks!


Trying to use auto margin-left/right: auto place image at the left hand side
Programming Languages

Positioning my image explicitly using left: places it correctly, however when I removed left: and replaced it instead with margin-left: auto and margin-right: auto it got positioned on the left hand side. What have I done wrong?


<body>
<div id = "main_header" href="http://xxx" >
<img id = "logo" src="logo.png"/>
<h1 id = "main_title">Title</h1>
</div>
body {
position:relative;
background-image: url("large_background.png");
font-family: Helvetica;
margin: 0; /* Amount of negative space around
What is the rationale behind margin-top: auto and margin-bottom: auto amounting to 0 margin?
Programming Languages

Since margin-right: auto and margin-left: auto center an element horizontally, I would expect their vertical counterparts to behave in the same way.


Yet I understand this does not happen, as per CSS specs:


10.6.2 Inline replaced elements, block-level replaced elements in normal flow, 'inline-block' replaced elements in normal flow and floating replaced elements

If 'margin-top', or 'margin-bottom' are 'auto', their used value is 0.


Also applies to block elements:


10.6.3 Block-level non-replaced elements in normal flow when 'overflow' computes to '

Privacy Policy - Copyrights Notice - Feedback - Report Violation - RSS 2017 © bighow.org All Rights Reserved .