Link to home
Start Free TrialLog in
Avatar of JAndyEvans
JAndyEvansFlag for United States of America

asked on

How do use css to add padding to an ASP.NET dropdownlist control?

I have textboxes that I can pad to make them look like I want, but how to do I pad ASP.NET dropdownlists?
Avatar of anoyes
anoyes
Flag of United States of America image

You should just be able to add the CssClass attribute to the drop down and set up the appropriate css in your stylesheets.  Have you tried this and had no luck?  Can you post the ddl code and css that you have?
you can put the dropdownlists inside a div also with padding
Avatar of JAndyEvans

ASKER

No, actually I want to pad the items in the dropdown.  Much like you would pad a textbox.
Ah, oh.  What you could do would be to add a class to the drop down list (ex. padded-list) and then in your css do this:

.padded-list option {
  padding: 4px;
}

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of amar31282
amar31282
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
here is the result
ddl.png