flex-basis

来源:互联网 发布:卢武铉在韩国名声知乎 编辑:程序博客网 时间:2024/05/21 04:42
<!doctype html><html><head>    <style type="text/css">        #main{            border: 1px solid black;                width: 400px;            height: 300px;            display: flex;        }        #div1{            width: 70px;            height: 70px;            background-color: pink;            flex-basis:40px;            }        #div2{            width: 70px;            height: 70px;            background-color: orange;        }        #div3{            width: 70px;            height: 70px;            background-color: green;        }        #div4{            width: 70px;            height: 70px;            background-color: yellow;        }    </style></head><body>    <div id="main">        <div id="div1"></div>        <div id="div2"></div>        <div id="div3"></div>        <div id="div4"></div>    </div></body></html>

这里写图片描述
It will replace the div’s width.

0 0
原创粉丝点击