flex布局

2019-04-02  本文已影响0人  卧龙2019

父元素使用display:flex

子元素:flex:1

<!DOCTYPE html>

<html>

<head>

<meta charset="UTF-8">

    <meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />

<title></title>

<style>

.flexBox{

display: flex;

}

.flexItem{

flex: 1;

}

</style>

</head>

<body>

<div class="flexBox">

<div class="flexItem">flex1</div>

<div class="flexItem">flex2</div>

<div class="flexItem">flex3</div>

</div>

</body>

</html>

上一篇 下一篇

猜你喜欢

热点阅读