This seems really simple but I can't even find something telling me that it's not possible, let alone how to do it.
I've got a page that uses expanded/multiple select
s, and I can't seem to control the height of the options. They look really snug. In Firefox, CSS values for option
in height
and line-height
both seem to have the desired effect, as does padding
, but not in Chrome 8 or Safari 5. Am I missing something? Here's a sample of my code. I've put in anything that could affect the option in case there's some overriding value that I'm missing.
body, input, select, checkbox {
font-family:'Avenir Lt Std',AppleGothic,'century gothic',Verdana,sans-serif;
font-size: 15px;
font-weight:200;
line-height: 18px;
}
input, select {
color:#4c2a18;
border: 1px solid #cfc8b4;
background-color:#ffffff;
-moz-border-radius: 0;
-webkit-border-radius: 0;
border-radius: 0;
margin:0;
}
option {
height: 35px;
padding:5px;
line-height: 35px;
}
<select size="5">
<option value="">This is option 1</option>
<option value="">Option 2</option>
<option value="">Just trying to show how the line height thing works.</option>
</select>
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…