下面代碼為什么margin-bottom以及margin-right不起作用啊?
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>填充</title>
<style type="text/css">
#box1,#box2{
? ? width:100px;
? ? height:100px;
? ??
? ? border:1px solid red;
? ? /*display:inline;*/
}
#box2{
? ? margin:5px 15px 10px 15px;
}
</style>
</head>
<body>
<div id="box1">盒子1
? ? <div id="box2">盒子2</div>
</div>
</body>
</html>
2020-03-21
<head>
#box2{
margin-top: 10px;
margin-bottom: 100px;
}
</style>
</head>
<body>
<div id="box1">盒子1</div>
<div id="box2">盒子2</div>
</body>
這樣寫
2020-03-21
你在盒子里面嵌套了盒子