【发布时间】:2012-01-24 05:34:06
【问题描述】:
我正在尝试纠正我的页面内容部分包含三列但 DIV 未正确浮动的问题。这是我的 HTML:
<div id="content">
<asp:ContentPlaceHolder ID="MainContent" runat="server">
</asp:ContentPlaceHolder>
</div>
<div class="columns">
<div id="borrower">
</div>
<div id="dealer">
</div>
<div id="investor">
</div>
</div>
<div class="footer">
</div>
这是我的 CSS:
body{
font-family:Verdana, Geneva, sans-serif;
font-size: 10px;
width:100%;
height: 100%;
}
#content
{
background-image: url('../Images/background_03.jpg');
background-repeat: no-repeat;
width: 1150px;
height: 399px;
}
#borrower
{
background-image: url('../Images/Borrower.jpg');
background-repeat: no-repeat;
width: 371px;
height: 248px;
float: left;
}
#investor
{
background-image: url('../Images/Lender.jpg');
background-repeat: no-repeat;
width: 371px;
height: 248px;
}
#dealer
{
background-image: url('../Images/dealer.jpg');
background-repeat: no-repeat;
width: 371px;
height:248px;
float: right;
}
#footer
{
clear:both;
}
使用上面的代码,Lender DIV 直接位于 Borrower DIV 下方,而不是位于 Borrower 和 Dealer 之间。我该如何纠正这个问题?
【问题讨论】: