Home >Web Front-end >HTML Tutorial >Select's best presets are fully compatible with all browsers select_HTML/Xhtml_Web page production
We know that the attributes of the select tag in each browser and the support of each browser are somewhat different, which causes the select box to be displayed differently in each browser. Next, we will create a fully compatible select by supporting the main appearance CSS attributes. .
I used control variables to control the height, padding, and line-height of select and wrote a DEMO to test three situations on each browser: height.100.padding.0, height.no.padding.100, no.height.no.padding, the results are as shown in the link image of each browser DEMO appearance
We can get the following research attributes.
ie6 |
ie7 |
ie8 |
ie9 |
ff |
ch |
sf |
op |
|
Default height |
22px |
22px |
19px |
20px |
19px |
19px |
||
height |
F |
T |
T |
T |
T |
T |
F |
T |
padding |
F |
F |
T |
T |
T |
T |
F |
T |
line-height |
F |
F |
F |
F |
F |
F |
T |
F |
Text vertically centered |
T |
T |
T |
F |
F |
T |
T |
T |