webveuje/csspress/demo2/boxmodel.html
2021-01-18 18:11:23 +08:00

55 lines
973 B
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
* {
margin: 0;
padding: 0;
}
div {
width: 120px;
height: 120px;
float: left;
}
.box1 {
background: blue;
}
.box2 {
background: green;
height: 80px;
border: 1px solid white;
}
.box {
width: 900px;
height: 600px;
background: pink;
}
.box3{
width: 120px;
height:120px;
background:gold;
/* clear: both; */
}
</style>
</head>
<body>
<div class="box">
<div class="box1"></div>
<div class="box2"></div>
<p class="box3">暖暖</p>
</div>
</body>
</html>