私はウェブページを持っていて、コンテナ内に2つのdivがありますcontent
-とsidebar1
。理由はわかりませんが、sidebar1
divを右側に配置するcontent
と、divの後に、サイドバーが横ではなく下に表示されます。
私のコード:
HTML
<div class="container">
<div class="content">
<p> </p>
<p> </p>
<h1><!-- TemplateBeginEditable name="Heading" -->Heading<!-- TemplateEndEditable --></h1>
<!-- TemplateBeginEditable name="Content" -->Just some
<!-- end .content -->
dummy text.<!-- TemplateEndEditable --></div>
<div class="sidebar1">
</div>
<div class="footer">
Footer text<!--end .footer --></div>
<!-- end .container --></div>
CSS
.sidebar1 {
float: right;
width: 20%;
padding-bottom: 10px;
}
.content {
padding: 10px 0;
width: 950px;
float: left;
border-left-color: #FFF;
border-right-color: #FFF;
}
.container {
width: 960px;
background-color: #000000;
margin: 0 auto;
}
私はまだHTMLに非常に慣れていないので、問題を理解していません。前もって感謝します!