HTML/Html-Css/19-flex布局.html
2023-05-01 19:37:40 +08:00

41 lines
734 B
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width-device-width,initial-scale=1.0">
<title>flex</title>
<style>
#app {
/* 变flex容器 */
display: flex;
height: 200px;
background-color: lightcoral;
}
.box {
background-color: lightgreen;
width: 100px;
height: 100px;
}
</style>
</head>
<body>
<div id="app">
<div class="box"><span>1</span></div>
<div class="box">2</div>
<div class="box">3</div>
<div class="box">4</div>
</div>
</body>
</html>