Flex-box ignores wrapped children's margin (margin collapse)


HOME ┬╗ 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;
height: 100px;
width: 100px;
background: red;
margin: 10px;
}
.inner {
height: 50px;
margin-top: 10px;
background: green;
}



Related to : Flex-box ignores wrapped children's margin (margin collapse)
Masonry ignores padding and margin
Web Design

I am using Masonry to assemble a wall of images (just like Pinterest), but it positions the tile elements regardless of their padding and margin.


Has anyone experienced a similar bug?


Firefox doesn't like margin auto with flex box model
Web Design

I am trying to center the header > section. It works fine with chrome and opera but firefox push to the left side. I created a class called .body with width: 960px and margin: 0 auto. It doesn't recognize margin: 0 auto on firefox (i am using firefox 18).


I have tried setting the display value to inline-block for .body class. It does centers it but it pushes the nav to bottom (for all browsers).


This is what i am trying to do


HTML


<header id="header">
<section class="body box">

Flex-box ignores wrapped children's margin (margin collapse)
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;
height: 100px;
width: 100px;
background: red;
margin: 10px;
}
.inner {
height: 50px;
margin-top: 10px;
background: green;
}



Floated Text Ignores Margin in IE
Web Design

I have a span tag floated to the left which for some reason moves up above the rest of the paragraph text and is actually cut off in ie8 and ie7. The text shows fine in ie9, but is shown above the rest of the text within the paragraph. The CSS for the span tag is:


.stat {
font: 64px/100% @numbersFont;
letter-spacing: -3px;
color: @orange;
float: left;
margin: 0 15px 5px 0;
}

The html is:


<p>
<span class="stat">10x</span>
One&nbsp;<a title="Fidelity® Charitable Gift Fund Volunteerism and Charitable Giving in 2009" href="http://ww
Floats and Margin Collapse
Web Design

so I'm having a hard time understanding the circumstances under which a float can have margins collapse through it and how that affects the position of the float. I've included a page that seems to show two different behaviors in the same page.


The red float seems to be positioned before the margins that collapsed through it, whereas the blue ones down below seem to have the margins collapse through them and then be positioned after those margins have collapsed.


Any help would be much appreciated.


Cheers,
Ben


<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title
What is the rationale behind margin-top: auto and margin-bottom: auto amounting to 0 margin?
Web Design

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 .