2012-01-03 89 views
1

我可以使用下面的代碼ASP.NET列表框與最小寬度和水平滾動條

<div style="width:160px; overflow-x:auto;"> 
     <asp:ListBox ID="ListBox1" runat="server"></asp:ListBox> 
</div> 

創建ASP.NET ListBox與水平滾動條,但我怎麼能在min-width屬性設置爲ListBox如此即使沒有物品存在,它也不會收縮。我嘗試了CSS的min-width,但沒有得到它。

我訪問了一個頁面here,但我不能在代碼格式化隱藏文件。

回答

0

哦~~ ..我的天啊!我使用文檔模式作爲IE 7標準。 min-width在IE 7中不起作用。

1

您可以通過像這樣的min-width CSS屬性設置爲100%實現這一點:

<asp:ListBox ID="ListBox1" runat="server" style="min-width:100%;"> 

希望這有助於。