我想將這兩個div並排放置在一起,但無論我做了什麼嘗試,即使它在另一個頁面上都有效,我會得到一個看起來像這樣的結果:在一個字段集合內並排放置兩個div
這裏是HTML(這是一個MVC網站,所以我用剃刀):
<fieldset id="AgentTypeFields" style="width: 400px;" >
<legend>Producer Info</legend>
<div id="BasicsContainer" style="clear:both;">
<div id="BasicsLeft" style="float: left;">
<div class="M-editor-label" >
@Html.LabelFor(model => model.ReferenceNumberType)
</div>
<div class="M-editor-label">
@Html.LabelFor(model => model.FormattedReferenceNumber)
</div>
<div class="M-editor-label">
@Html.LabelFor(model => model.ProducerType)<span class="req">*</span>
</div>
<div class="M-editor-label">
@Html.LabelFor(model => model.EffectiveDate)<span class="req">*</span>
</div>
<div class="M-editor-label">
@Html.LabelFor(model => model.JIT)
@Html.CheckBoxFor(x => x.JIT)
</div>
<span id="ExternalRepId">
<div class="M-editor-label">
@Html.LabelFor(model => model.ExtRepID)
</div>
</span>
</div>
<div id="BasicsRight" style="float:right;">
<div class="M-editor-field" style="margin-right: 120px;" >
@Html.RadioButtonFor(model => model.ReferenceNumberType, "S") SSN
@Html.RadioButtonFor(model => model.ReferenceNumberType, "E") EIN
</div>
<div class="M-editor-field" id="refNumber" style="margin-right:138px;">
@if (ViewBag.FullSSN)
{
@Html.DisplayFor(model => model.FormattedReferenceNumber)
}
else
{
@Html.Raw("xxx-xx-")@Html.DisplayFor(model => model.displayLastFour)
}
</div>
<div class="M-editor-field" style="margin-right:82px;">
@Html.DropDownListFor(x => x.ProducerType, (SelectList)ViewBag.ProducerChoices, new { id = "drpProducerType" })
</div>
<div class="M-editor-field">
@Html.TextBoxFor(model => model.EffectiveDate, new { maxlength = 10 })
@Html.ValidationMessageFor(model => model.EffectiveDate)
</div>
<div class="M-editor-field">
@Html.LabelFor(model => model.HoldBool)
@Html.CheckBoxFor(x => x.HoldBool)
</div>
<span id="ExternalRepId">
<div class="M-editor-field">
@Html.TextBoxFor(model => model.ExtRepID, new { maxlength = 40 })
</div>
</span>
</div>
</div>
</fieldset>
這是遵循的模式:http://alistapart.com/article/prettyaccessibleforms –