移动端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>
posted @ 2019-10-15 21:06  Running00  阅读(369)  评论(0编辑  收藏  举报