css - div 没有正确并排对齐

标签 css html css-float

我的应用程序中并排放置了 3 个 div,在 div 之后,我保留了一个提交按钮。

如果我在日期选项中选择“今天”,这就是提交按钮的样子:

enter image description here

但如果我选择特定日期,则会发生以下情况:

enter image description here 这是代码的样子:

<div class="filters clearfix" style="float:left" id="sel_filters">
    <div class="fields">
       <div class="10">
          <!-- this is for the date option . it contains a label and select element-->
       </div>
       <div>
          <!-- label for start date and an input box -->
       </div>
       <div>
          <!-- label for end date and an input box -->
       </div>
       <div>
          <!-- label for adnetwork options "&nbsp;" and the select element -->
       </div>
       <input id="startdate_hidden" type="hidden" style="display:none;" value="" name="data[Fam][startdate_hidden]">
        <input id="enddate_hidden" type="hidden" style="display:none;" value="" name="data[Fam][enddate_hidden]">
        <input id="submit" class="stdButton" type="submit" onclick="return  updateAddetailsNetworkWiseReport();" value="Submit" name="submit">
    </div>
</div>

现在的样式:

.clearfix:after 
{
  clear: both;
  content: ".";
  display: block;
  height: 0;
  visibility: hidden;
}
div#sel_filters 
{
  margin-left: 10px;
  width: 754px;
}

div.filters div.fields 
{
  background: url("/img/bg_summary.gif") no-repeat scroll right bottom #FFFFFF;
  height: 38px;
  padding-right: 10px;
}
div#sel_filters div.fields div.l0 
{
  margin-left: 0;
}

我在最外层的 div 中添加了 style="float:left" ,但这个问题仍然存在。确切的解决方案是什么?

最佳答案

在我看来,在底部图像上,日期框旁边出现了两个图像,这导致元素对于包含的 div 来说太宽了。

尝试调整一些元素的大小,使它们缩小 20-30 像素或;使包含的分区宽度更大,这应该可以工作。

关于css - div 没有正确并排对齐,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8353686/

相关文章:

javascript - 首次调用返回类型函数时未调用两个 javascript 函数

css - CSS 网格中的 float 元素

html - 如何使背景只适合指定的 float child

CSS 选择器代码最后一个元素

css - Primefaces FileUpload - 简单的 Bootstrap 样式?

html - 使叠加层上的文本变白

javascript - 类型错误 : Cannot read property 'length' of null

html - 在 flexbox Divs 中添加可滚动的 Div

javascript - Angular 指令默认为选中状态

css - IE7 兼容性 float :right inside float:right