问题
DIV
如果两个宽度都是,则第二个是换行50%
,但是如果我将其中一个宽度设为,DIVs
49%
它将布局为两列。这是预期的行为还是我做错了什么?
CSS
.box
{
display: block;
width: 100%;
padding: 0;
}
.box.twocolumn .column1
{
display: inline;
float: left;
width: 50%;
padding: 0;
margin: 0;
}
.box.twocolumn .column2
{
display: inline;
float: left;
width: 50%;
padding: 0;
margin: 0;
}
HTML
<div class="box">
<div class="box twocolumn">
<div class="column1">
<label>
Start Date:</label>
<asp:TextBox ID="StartDate" CssClass="datepicker" runat="server"></asp:TextBox>
</div>
<div class="column2">
<label>
End Date:</label>
<asp:TextBox ID="EndDate" CssClass="datepicker" runat="server"></asp:TextBox>
</div>
</div>
</div>