I would like to create a dropdown menu with html select thus I would like to style it as well. I would like to set a padding to the option tags so they wouldn't be so overcrowded, but I can't do so. (it doesn't work) any idea?
#categories
{
padding: 10px 10px 10px 10px;
background-color: #826B78;
font-size: 20px;
color: white;
margin: 10px 10px 10px 10px;
border: none;
outline: none;
}
#categories option
{
margin: 30px 30px 30px 30px;
padding: 30px 30px 30px 30px;
font-size: 20px;
}
the categories id belongs to the select tag
html5 specification does not provide generic style properties to customize this user input control element. the only way found on net was using label element to reference this control for styling purpose
It is difficult to style select menu with css. The Best way of doing it is with jquery u can style and have a better control over the code with jquery. Just use a custom jquery like http://gregfranko.com/jquery.selectBoxIt.js/
I have just made an example of styling select with jquery, you can check the demo here
You can give style to select tag like this or you can use class name or id as well
Disabling the default setting can enable you a little more freedom - give your select a class, within that class use the following:
and then add in your default style
According to those bootstrap people