84669 person learning
152542 person learning
20005 person learning
5487 person learning
7821 person learning
359900 person learning
3350 person learning
180660 person learning
48569 person learning
18603 person learning
40936 person learning
1549 person learning
1183 person learning
32909 person learning
面试的时候碰到的问题, 如何实现四栏等宽,中间设置一定间隙的自适应布局:
如图,在未知宽度的父容器中, 里面四列等宽,中间间隙相等,比如10px:(我目前只想到是用JS先获取父容器宽度,然后通过减去间隙,再计算设置列的宽度后设置列宽度),有没有不用JS的方法?
闭关修行中......
四列等框 p1 p2 p3 p4
p1
p2
p3
p4
你可以这样试试:(假设外层容器的宽度为100%),.wrap p{
background: blue; float:left; width:20%; height:100%; margin:0 2.5%; }
bootstrap的栅格系统
你可以这样试试:(假设外层容器的宽度为100%),
.wrap p{
bootstrap的栅格系统