Home >Web Front-end >HTML Tutorial >CSS method to solve the option height of select drop-down form_html/css_WEB-ITnose
css can be easily handled when setting styles such as borders for the select drop-down form, but when we didn’t like the default drop-down arrow style, we tried to modify it through background:url (picture path), Browser compatibility issues often arise. After checking a lot of information on the Internet, the best solution is for the experts to use js to simulate the drop-down form. Um~, okay, let’s solve this problem according to the methods of the masters for the time being.
Let’s talk about how to solve the option height of select in css?
Sometimes after we set the height of the select, we find that the height of the option is still the default height, which is very different from the height of the select we set. Obviously, this is not what we want. The author also checked the information on the Internet, but it seems that I have not found the cause of this problem. If there is an expert who knows about it, please feel free to enlighten me. So how to achieve the height of option to achieve the effect we want? Without further ado, it’s actually very simple.
Solution:
Just set the top and bottom padding of the option directly, that is, padding-top and padding-bottom.
Haha. . . Isn’t it very simple, go and try it quickly.
As for how to set the background color when the mouse passes over the option, the author is still exploring further. If there are experts who know, please feel free to enlighten me.
Experts please pass on the above solutions~~