嗨,我有關於我的div標籤的問題。我遵循這個教程,我專門做了他所做的並得到了不同的結果。我已經搜索了這個,我找不到答案。CSS,HTML無法將div內容放在div標籤內
問題是我的content_wrapper div中的div標籤不會將自己置於content_wrapper div中,即使我專門做了與本教程中相同的操作。相反,div標籤將自己置於我的content_wrapper div底部。如果有任何幫助,我正在使用Dreamweaver CS5。
這是我怎麼寫我的div:
<body>
<div id="header"> This is my header </div>
<div id="content_wrap">
<div id="left_content"> Advertisement </div>
<div id="right_content"> </div>
</div>
</body>
這是我的CSS:
#header{
height:1000px;
width:1000px;
margin-left:auto;
margin-right:auto;
border:solid 1px;
}
#content_wrapper{
height:800px;
width:980px;
margin-left:auto;
margin-right:auto;
margin-top:10px;
}
#left_content {
height:800px;
width:240px;
float:left;
margin-left:auto;
margin-right:auto;
border:solid 1px;
}
#right_content {
height:800px;
width:730px;
margin-left:10px;
margin-right:auto;
float:right;
border:solid 1px;
}
'content_wrap'!='content_wrapper' – Barmar 2013-02-08 22:22:54
檢查你的CSS的寬度,高度,邊距和填充。 – j08691 2013-02-08 22:23:46