Home > Web Front-end > HTML Tutorial > CSS method to solve the option height of select drop-down form_html/css_WEB-ITnose

CSS method to solve the option height of select drop-down form_html/css_WEB-ITnose

WBOY
Release: 2016-06-24 11:49:37
Original
5347 people have browsed it

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~~

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template