移动端display:flex

移动端display:flex布局时候,子元素有背景颜色时候,背景颜色不能铺满,有缝隙,

// less
.t-flex {
     background: blue;
     display: flex;
     > div:first-child {
         width: 100%;
     }
     > div:last-child {
         width: 100%;
     }
     > div {
         width: 30px;
          background: blue;
         height: 30px;
         flex: 1;
     }
 }
<div className="t-flex">
    <div></div>
    <div>1</div>
     <div></div>
 </div>

猜你喜欢

转载自www.cnblogs.com/Running00/p/11680951.html