0

Please see this codepen: http://codepen.io/aaron/pen/Anqri

If the .item-container's height is changed to any other positive percentage, nothing happens. However, changing the height to a negative percentage, a pixel value, or removing it causes the images to grow and no longer be 25%.

I cannot understand why the percentage height is necessary and yet the number does not matter.

4

1 回答 1

1

那是因为没有父母.item-container有明确的高度。CSS 中的百分比值取决于在父对象上设置的显式值。

于 2013-07-18T21:33:22.560 回答