6 ms·
http://www.w3.org/TR/CSS2/box.html#margin-properties http://www.w3.org/TR/CSS2/box.html#margin-properties When margin top or bottom is a percentage, it refers
by bgrins 15y ago
http://www.w3.org/TR/CSS2/box.html#margin-properties http://www.w3.org/TR/CSS2/box.html#margin-properties
When margin top or bottom is a percentage, it refers to the width, not height, of the containing block. If the parent is 100% width (say, the body), the element will move down 50% of your screen width.
Usually, you don't want this, but you can use it to do some cool tricks with keeping the aspect ratio of an element, like this: http://jsfiddle.net/bgrins/999FP/ http://jsfiddle.net/bgrins/999FP/