css 例子
This commit is contained in:
55
csspress/demo2/boxmodel.html
Normal file
55
csspress/demo2/boxmodel.html
Normal file
@@ -0,0 +1,55 @@
|
||||
<!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>
|
||||
Reference in New Issue
Block a user