Css 如何为dropdownlist ListItem(选项)设置样式?
我想设置选项的样式(asp: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
<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 & OTP</asp:ListItem>
<asp:ListItem Value="2">Email & Password</asp:ListItem>
</asp:DropDownList>
选择权{
光标:指针;
字体大小:400;
线高:40px;
列表样式:无;
最小高度:40px;
大纲:0;
宽度:100%;
左侧填充:18px;
右边填充:29px;
文本对齐:左对齐;
-webkit转换:all.2s;
过渡:all.2s;
}
流动电话及;检察官办公室
电邮及;密码
请提供帮助。浏览器不会放弃选择选项样式,我们也无法覆盖它的样式。因此,我们必须使用无序列表显示为选择下拉列表。或者你可以在网上免费找到一个定制的选择下拉列表,或者你可以自己写一个。你可以将其应用于asp:dropdownlist