Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/34.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Css 如何为dropdownlist ListItem(选项)设置样式?_Css_Asp.net - Fatal编程技术网

Css 如何为dropdownlist ListItem(选项)设置样式?

Css 如何为dropdownlist ListItem(选项)设置样式?,css,asp.net,Css,Asp.net,我想设置选项的样式(asp:ListItem)。我尝试设置选项的样式,但并没有成功,仍然是线高度和默认值相同 <style> option { cursor: pointer; font-weight: 400; line-height: 40px; list-style: none; min-height: 40px; outline: 0; width: 100%; padding-left: 18px; padding-right: 29px; text-align: left

我想设置选项的样式(asp:ListItem)。我尝试设置选项的样式,但并没有成功,仍然是线高度和默认值相同

<style>
option {
cursor: pointer;
font-weight: 400;
line-height: 40px;
list-style: none;
min-height: 40px;
outline: 0;
width: 100%;
padding-left: 18px;
padding-right: 29px;
text-align: left;
-webkit-transition: all .2s;
transition: all .2s;
}
</style>

<asp:DropDownList ID="DropDownList1" class="form-control" AutoPostBack="true" 
OnSelectedIndexChanged="DropDownList1_SelectedIndexChanged" Style="margin-bottom: 20px; width: 100%;" runat="server">
<asp:ListItem Value="1" Selected="true">Mobile &amp; OTP</asp:ListItem>
<asp:ListItem Value="2">Email &amp; Password</asp:ListItem>
</asp:DropDownList>

选择权{
光标:指针;
字体大小:400;
线高:40px;
列表样式:无;
最小高度:40px;
大纲:0;
宽度:100%;
左侧填充:18px;
右边填充:29px;
文本对齐:左对齐;
-webkit转换:all.2s;
过渡:all.2s;
}
流动电话及;检察官办公室
电邮及;密码

请提供帮助。

浏览器不会放弃选择选项样式,我们也无法覆盖它的样式。因此,我们必须使用无序列表显示为选择下拉列表。或者你可以在网上免费找到一个定制的选择下拉列表,或者你可以自己写一个。你可以将其应用于asp:dropdownlist