我想将这两个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 –