Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I add padding to html dropdownlist?

Tags:

html

css

I want to add padding to the options of html "select" tag.

I try to add it in the style property of "select" and "option" and it doesn't work in IE.

What can I do?

like image 874
Billy Avatar asked Jul 05 '09 08:07

Billy


People also ask

How do you add padding to a dropdown list in HTML?

The width is to allow enough room in the displayed select box when not active, the margin does what it always does, text-indent is used to feign padding between the left boundary of the select box and the inner-text. line-height is just to allow vertical spacing.

Can you add padding in HTML?

When you want to add space around an HTML element's content then you'll use the padding properties. The padding shorthand property allows us to set the padding on all four sides at once instead writing out padding-top , padding-right , padding-bottom , padding-left .


1 Answers

OK, I hate to sound all 1990s, but would simply pre- and app-ending a space to the option text be acceptable for your desired goals?

like image 105
DVK Avatar answered Sep 20 '22 02:09

DVK