Html 使用CSS网格的行间距为1px
我正在尝试创建自定义css网格:Html 使用CSS网格的行间距为1px,html,css,Html,Css,我正在尝试创建自定义css网格: .row box-sizing: border-box background-color: tomato font-size: 0 .row:after content: "" display: table clear: both [class*="col-"] float: left min-height: 1px box-sizing: border-box .col-1-4 width: 25% .col-3-4
.row
box-sizing: border-box
background-color: tomato
font-size: 0
.row:after
content: ""
display: table
clear: both
[class*="col-"]
float: left
min-height: 1px
box-sizing: border-box
.col-1-4
width: 25%
.col-3-4
width: 75%
.col-2-3
width: 66.66667%
.col-1-3
width: 33.33333%
但当我缩放页面时,行的末尾会出现1px的间隙:
那么,如何避免这种情况呢?可能这只是一个舍入误差。另见: 您可以通过给出行中的最后一列
width:auto
来避免这种情况