» Home » Margin » Page 1
Margin left/right auto and 900px width is positioning with extra wide margin on the iPad/iPhone only
by The Merg in 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="wrapp

Flex-box ignores wrapped children's margin (margin collapse)
by xSauronx in Web Design

Given the following HTML:


<div class="outer">
<div>
<div class="inner">A</div>
</div>
</div>
<div class="outer">
<div class="inner">B</div>
</div>

and the following CSS (prefix free):


.outer {
display: box;
box-orient: vertical

CALayer resizing with flexible width, left margin and right margin
by Mahi in Development Tools & Services

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


How can I make the bottom margin of a div equal to its percentage-calculated right margin?
by mckasty in Programming Languages

I have an array of floating divs that fit 4 to a row. Their widths and right margins add up to 100%. Their bottom margins, however, are static. CSS below:


.item {
position: relative;
float: left;
height: 200px;
width: 23%;
margin-right: 2%;
margin-bottom: 15px;
background-color: #ddd;
}

Is th


Android: margin/padding for the ListView without having the margin applied to the header?
by cjdavis in Programming Languages

Is it possible to have a margin/padding for the ListView without having the margin applied to the header? I want my ListView to be like the Google Now layout. I've got everything working except for this little problem.


Question: Is it possible to not have layout parameters of the ListView apply to its header?


EDIT1:More info


The purple view is the header to t


How to Format a Letter Using a Default Left & Right Margin & a Two Inch Top Margin
by Twista in Computers
Word processors allow the user to type virtually anything and fine-tune the formatting of documents with a few clicks of the mouse. Tasks from changing font color and type to setting margins take a fraction of the time they took with older, analog methods. However, to properly adjust the margins of a letter document, you must use the correct steps for your word processing software. These steps var

Find first element in div that has margin? (purpose: remove margin)
by Brian in Web Design

I need to find the first (and last) element in a div that has a CSS margin set (> 0 px). (important: this is not necessarily the first or last element!)


Basically, I need to do this so that I can remove the margin-top for the first element and the margin-bottom for the last. Now I know you'll probably say "why not use "p:last" CSS syntax?"


Because the first or last eleme


How do negative margins in CSS work and why is (margin-top:-5 != margin-bottom:5)?
by New Jersey in Web Design

A common trick for vertical positioning elements is to use the following CSS:


.item {
position:absolute;
top:50%;
margin-top:-8px; /* half of height */
height: 16px;
}

When seen in the metric view as in Chrome this is what you see:



However, there is no visual margin depicted when you hover over


margin-top and margin-bottom inside floated div not working
by Bernhard in Web Design

I have a problem with margin-top and margin-bottom for some elements inside a floated div.


It's a column div floated to the right (I have also 2 other column divs floated to the left)


Demo here:
http://jsfiddle.net/zTb3g/


I need the "float" to adjust columns in the page, but the margin-top and margin-bottom don't work in some of the elements (ex: b, labe


Does margin-left:2px; render faster than margin:0 0 0 2px;?
by Ed. in Web Design

Douglas Crockford describes the consequence of Javascript inquiring a node's style. How simply asking for the margin of a div causes the browser to 'reflow' the div in the browser's rendering engine four times.


So that made me wonder, during the initial rendering of a page (or in Crockford's jargon a "web scroll") is it faster to write CSS that defines only the non-zero/non-default


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