【发布时间】:2015-03-02 05:41:32
【问题描述】:
您好,我正在尝试显示 5 列布局,但第五列显示在下方。
.five-col{
float:left;
width: 20%;
}
我检查了布局,宽度为 1903 像素 (100%)。而且每个.five-col都是381px所以381*5=1905px是解决方案吗?
【问题讨论】:
标签: css google-chrome safari rounding-error
您好,我正在尝试显示 5 列布局,但第五列显示在下方。
.five-col{
float:left;
width: 20%;
}
我检查了布局,宽度为 1903 像素 (100%)。而且每个.five-col都是381px所以381*5=1905px是解决方案吗?
【问题讨论】:
标签: css google-chrome safari rounding-error
没有发现任何问题:http://jsfiddle.net/4uwckjzh/
HTML:
<div class="five-col"></div>
<div class="five-col"></div>
<div class="five-col"></div>
<div class="five-col"></div>
<div class="five-col"></div>
CSS:
.five-col{
height: 50px;
border: 1px solid black;
box-sizing: border-box;
}
.five-col{
float:left;
width: 20%;
}
也许是因为缺少盒子尺寸?
【讨论】: