2013-03-07 65 views
0

我有以下aspx代碼片段。在IE9標準模式下,即使第一個listLabel的左邊沒有任何東西,第一個listLabel仍然會向右移動並強制其餘listLabels及其ListBox的一行。在IE9兼容性視圖模式下,所有listLabels和ListBox都在同一行上。我嘗試了很多css設置,但沒有成功。我寧願不使用浮動。有誰知道爲什麼會發生這種情況,以及如何解決問題?謝謝。IE9標準模式和兼容性查看模式對齊

label.listLable 
{ 
    /*vertical-align:top;*/ 
    font-weight:bold; 
} 


    <asp:Content ID="pageContent" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server"> 
     <div> 
      <div> 
       <label for="<%=listPcpPanel.ClientID%>" class="listLable">Panel: </label> 
       <asp:ListBox ID="listPcpPanel" runat="server" SelectionMode="Multiple" Rows="1"> 
        <asp:ListItem Value="&lt;----- All -----&gt;" Selected="True"></asp:ListItem> 
       </asp:ListBox> 
       <label for="<%=listFacilityService.ClientID%>" class="listLable">Service: </label> 
       <asp:ListBox ID="listFacilityService" runat="server" SelectionMode="Single" Visible="true" Rows="1"> 
        <asp:ListItem Value="&lt;---Select one---&gt;" Selected="True"></asp:ListItem> 
       </asp:ListBox> 
       <label for="<%=listRole.ClientID%>" class="listLable">Role: </label> 
       <asp:ListBox ID="listRole" runat="server" SelectionMode="Multiple" Visible="true" Rows="1"> 
        <asp:ListItem Value="&lt;----- All -----&gt;" Selected="True"></asp:ListItem> 
       </asp:ListBox> 
      </div> 
     ... 
     ... 
     </div> 
    </asp:Content> 
+0

請儘可能上傳截圖。 – Win 2013-03-07 23:46:48

回答

0

我把它通過去除前<DIV>孩子<的ASP解決:內容>。