2012-01-03 100 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%;"> 

希望这有助于。