format text in dropdownlist

  • Thread starter Thread starter Klaas
  • Start date Start date
K

Klaas

Hi,

Is it possible to get the text in a dropdown list to be bold or italic?
Some entries I want to have bold others normal and others italic.
I cant figure out how to do this.

tia
 
hi, you can test this yourself easily. Here is a basic test below.

<asp:DropDownList style="font-weight: bold;" ID="DropDownList1"
runat="server">
<asp:ListItem style="font-color:
red;background-color:green">a</asp:ListItem>
<asp:ListItem style="color: red">b</asp:ListItem>
<asp:ListItem style="font-family: Verdana; font-size: 16px"
Value="c">c</asp:ListItem>
</asp:DropDownList>

In the above test, note how the font-weight is being applied in the
dropdownlist(select element) itself and not on the listitem. Applying it on
the list item has no effect in IE. Only Firefox seems to support this. The
same for font-family and font-size. Cant be applied individually on the
listitem(option element).

You can try other options whereas to using font-weight. Try color or
background-color, those work at the listitem level, cross browser.

Regards,
Alessandro Zifiglio
http://www.AsyncUI.net
 
Your welcome. Yes, from that small test you can see that font-weight is
ignored on the listitem and cannot be applied individually in IE. Only
firefox seems to have this working :|

So your left with specifying font-weight on the dropdownlist itself but this
will apply to all listitems and wont set individually.

Regards,
Alessandro Zifiglio
http://www.AsyncUI.net
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top