<分区>
我有 2 个文件:1 个是 .html
文件和另一个文件是.css
文件
以下是它们的内容:
#left,
#right {
display: inline-block;
}
#left {
width: 15%;
height: 550px;
margin-bottom: 100px;
margin-left: 10px;
border: 1px solid black;
}
#right {
width: 80%;
margin-left: 25px;
}
#header {
width: 100%;
height: 100px;
border: 1px solid black;
}
#content {
width: 100%;
height: 500px;
border: 1px solid black;
margin-top: 10px;
}
#footer {
width: 100%;
height: 100px;
border: 1px solid black;
margin-top: 10px;
}
#menu {
width: 100%;
height: 50%;
background-color: red;
}
<div id="left">
</div>
<div id="right">
<div id="header">
</div>
<div id="content">
</div>
<div id="footer">
</div>
</div>
如果我加 1 <h1>
里面的元素#left
或 #header, #footer, #content
然后他们的位置向下移动。
我不知道为什么会这样。请帮忙。