CSS 使用 bootstrap v3 为 asp.net 下拉列表控件添加样式
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/19541615/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Adding style for asp.net drop-down list control using bootstrap v3
提问by user2848976
I was trying to add style for asp.net drop-down list control using bootstrap 3. But it is not applying. Earlier it worked with bootstrap 2.3.2 without any changes.
我试图使用 bootstrap 3 为 asp.net 下拉列表控件添加样式。但它不适用。早些时候它与 bootstrap 2.3.2 一起工作,没有任何变化。
Can anybody suggest me a way to do this. Many thanks.
任何人都可以建议我这样做的方法。非常感谢。
回答by Morpheus
I would say this would be enough:
我会说这就足够了:
<asp:DropDownList runat="server" CssClass="form-control" ID="something" />
Take a look at bootstrap docsand scroll down to the Selectssection.
查看bootstrap 文档并向下滚动到Selects部分。
回答by Mohsen Fathi
You can use this and change btn whatever you want:
<asp:DropDownList Width="100%" CssClass="btn btn-default btn-sm" ID="DPCID" runat="server"/>
您可以使用它并根据需要更改 btn :
<asp:DropDownList Width="100%" CssClass="btn btn-default btn-sm" ID="DPCID" runat="server"/>