即8个浏览器发布div下一行

时间:2013-01-15 23:24:49

标签: html css html5 css3 internet-explorer-8

<8>在ie8中,span标签正在下降,它们不在同一行 如何解决它.. 我改变宽度不工作

http://jsfiddle.net/DA9gK/26/

<div style="height: 54px;">
          <span class="companyLogo">Company LOGO</span>
          <span class="quotes" style=" ">Quotes</span>
          <span class="saleOrders" >Sale Orders</span>
          <span class="invoice">Invoice</span>
          <span class="openAr" >Open AR</span>
          <div style="margin-left:592px; ">
            <span class="payments" style=" height: 21px; width: 94px;">Payments</span>
            <span class="createMemos" style=" height: 21px; width: 94px;">Create Memos</span>
            <span class="rma" style=" height: 21px; width: 94px;">RMA</span>
            <span class="crm" style=" height: 21px; width: 94px;">CRM</span>
          </div>
      </div>

1 个答案:

答案 0 :(得分:0)

boot.rap.css将div.container的宽度设置为1000px。 第二个div(包含跨度)的左边距是592px。 跨度内容的宽度加上左边距大于1000px,因此它将跨度换行到下一行。

为了演示,我将容器宽度覆盖为“auto!important”。

.container {
  margin: 0 auto;
  width:auto !important;      
}

http://jsfiddle.net/VXXPC/

编辑: 另一个演示,我调整了这些跨度的左边距:

.quotes {
  ...
  margin-left: 400px;
}

element.style {
  margin-left: 552px;
}

http://jsfiddle.net/3QTny/

考虑使用浮点数而不是左边距。