50 lines
849 B
HTML
50 lines
849 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>外边距 </title>
|
||
|
|
||
|
<style>
|
||
|
#app {
|
||
|
width: 300px;
|
||
|
height: 300px;
|
||
|
background-color: orangered;
|
||
|
|
||
|
/* No.1 设置内边距*/
|
||
|
padding-top: 1px;
|
||
|
|
||
|
/* No.2 边框 */
|
||
|
border: solid 1px pink;
|
||
|
}
|
||
|
.box {
|
||
|
width: 100px;
|
||
|
height: 100px;
|
||
|
background-color: lightseagreen;
|
||
|
|
||
|
margin-top: 100px;
|
||
|
|
||
|
|
||
|
/* 块盒子的margin上下穿透问题 , 左右不存在*/
|
||
|
}
|
||
|
|
||
|
|
||
|
|
||
|
</style>
|
||
|
|
||
|
</head>
|
||
|
|
||
|
<body>
|
||
|
|
||
|
<div id="app">
|
||
|
123
|
||
|
<div class="box"> </div>
|
||
|
|
||
|
</div>
|
||
|
|
||
|
</body>
|
||
|
|
||
|
</html>
|