1.margin{top,right,bottom,left}
mangin:一个参教四个方向都会散变
二个参数第一个参数top, bottomi第二个参数Left,right
三个参数第一个top第二个参数might,left第三个参数bottom
<!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>
div {
width: 100px;
height: 100px;
background-color: red;
/*
top, right, bottom,Left
mangin:一个参教四个方向都会散变
二个参数第一个参数top, bottomi第二个参数Left,right
三个参数第一个top第二个参数might,left第三个参数bottom
*/
margin: 100px 200px 300px 400px;
}
</style>
</head>
<body>
<div>
</div>
</body>
</html>
2.margin,border,padding,content
<!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,borde,padding,content */
div {
width: 100px;
height: 100px;
background-color: red;
margin-left: 10px;
margin-top: 100px;
border: 1px solid #333;
/*top,right,bottom, right*/
padding-left: 100px;
padding-right: 100px;
}
</style>
</head>
<body>
<div>
</div>
</body>
</html>