1

I have a block level element containing 25 floated blocks, I set the width:20% and height: 20%

depending on the height there is sometimes a gap, but width is always correct.

#grid{
  width: 880px;
  height: 333px; 
  background: blue;
}
#grid a{
  display: block;
  float: left;
  width: 20%;
  height: 20%;
  background: red
}

please see http://jsfiddle.net/wVC5j/

how can i I ensure the gap at the bottom doesn't exist?

4

1 回答 1

0

我似乎已经使用20.15%高度而不是仅仅 20 解决了这个问题。
这有时会导致一些溢出,但根据我的测试,当高度改变时没有出现蓝色。

http://jsfiddle.net/wVC5j/3/

于 2013-03-08T03:47:33.333 回答