CSS定宽居中的实现方案

方案1:使用flex来布局

.box{
    width: 100%;
    height: 100px;
    display: flex;
}
.d1{
    flex-grow: 1;
    flex-shrink: 1;
}
.d2{
    flex-basis: 1080px;
    background-color: pink;            
    flex-grow: 0;
    flex-shrink: 0;
}
.d3{
    flex-grow: 1;
    flex-shrink: 1;
}

方案二:未完待续...

posted @ 2018-01-12 20:44  PeriHe  阅读(183)  评论(0编辑  收藏  举报