T
T
TimLee2014-08-02 01:49:15
css
TimLee, 2014-08-02 01:49:15

Why doesn't Firefox render margin-top and margin-bottom?

Here codepen.io/tbl/pen/CxLsH clearly shows what I'm stuck on
Rule:

div {
  margin: 1%;
}

In Chrome, it gives the expected padding around the block. Firefox only has padding on the right and left.
Unfortunately, toster does not allow you to upload a picture for comparison, where you can see two browsers at once.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
W
whats, 2014-08-02
@TimLee

learn.javascript.ru/height-percent
Read how the percentage of heights is calculated.
The flexbox standard says the following:

Percentage margins and paddings on flex items are always resolved against their respective dimensions; unlike blocks, they do not always resolve against the inline dimension of their containing block.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question