xgqfrms™, xgqfrms® : xgqfrms's offical website of cnblogs! xgqfrms™, xgqfrms® : xgqfrms's offical website of GitHub!

flex layout & demos

flex layout & demos

https://codepen.io/xgqfrms/pen/jjLPKN

https://css-tricks.com/snippets/css/a-guide-to-flexbox/


.flex-box {
    dispaly: flex;
    border: 1px solid red;
    height: 100px;
    position: relative;
    display: flex;
    flex-flow: row wrap;
    justify-content: flex-start;
    align-items: stretch;
    align-content: stretch;
    box-sizing: border-box;
    margin: 10px;
}

.flex-item {
    height: 30px;
    margin: 5px;
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

.item1 {
    flex: 1 1 auto;
    width: 80vw;
    background: #0f0;
}
.item2 {
    flex: 0 1 auto;
    width: 20vw;
    background: #f0f;
}
.item3 {
    flex: 1 1 auto;
    width: 20vw;
    background: #0f0;
}
.item4 {
    flex: 0 1 auto;
    width: 20vw;
    background: #f0f;
}

refs



©xgqfrms 2012-2020

www.cnblogs.com 发布文章使用:只允许注册用户才可以访问!


posted @ 2019-06-26 09:17  xgqfrms  阅读(205)  评论(2编辑  收藏  举报