0

I want to style the option(asp:ListItem). I tried setting style of option but no luck,Still line-height is same as default.

<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>

Please help.

sanjeev
  • 67
  • 1
  • 9
  • Browsers do not give away the select - option styling, and there is no way we can override the styling for it. Hence we have to use unorderedList to appear as select dropdown. orelse you might find a custom made select dropdown js online for free or you could write one on your own. – vssadineni Sep 16 '19 at 12:25
  • You may be able to adapt this for an asp:dropdownlist https://stackoverflow.com/questions/30187570/styling-selected-option – EGC Sep 16 '19 at 23:38

0 Answers0