為什么.box div的width超過500,就看不到我給.box設(shè)置的底色了?
<style type="text/css">
? ? .box {
? ? ? ? width:800px;
? ? ? ? background: blue;
? ? ? ? display: flex;
? ? ? ? justify-content:flex-end;
? ? }
? ? .box div {
? ? ? ? width: 500px;
? ? ? ? height: 500px;
? ? }
? ? .box1 {
? ? ? ? background: red;
? ? }
? ? .box2 {
? ? ? ? background: orange;
? ? }
? ? .box3 {
? ? ? ? background: green;
? ? }
? ? </style>
2020-08-08
box寬度才800px,box1/2/3一個就有500px了,三個要占完box的寬度,你要設(shè)置父元素寬度大于子元素寬度之和才能顯示父元素的背景色
2020-08-01
父盒子沒有設(shè)置高度 ,因為是彈性盒子,box1 2 3 會默認(rèn)排序占完一排 此時寬度就沒有用