2016-04-06 16 views
0

選択ボックス要素間の行間を増やしたいと考えています。CSSの使い方選択ボックス要素間の行間隔を増やす

私はline-heightmin-heightを試しましたが、これは選択ボックスの要素間隔に影響します。

このプロパティを使用することができますか?

.input { 
    padding-bottom:5px; 
    margin-right:8px !important; 
    margin:4px; 
} 

ここで私はmin-heightを持っている:ここでは

select, textarea { 
    background: #eee; 
    border: 1px solid #aaa; 
    border-right-color: #ddd; 
    border-bottom-color: #ddd; 
    -webkit-box-shadow: none; 
    -moz-box-shadow: none; 
    box-shadow: none; 
    width: 100%; 
    min-height: 30px; 
    font-weight: normal; 
} 

私はline-heightを持っている:

select, textarea { 
    display: inline-block; 
    height: 20px; 
    padding: 4px 6px; 
    margin-bottom: 5px; 
    font-size: 12px; 
    line-height: 20px; 
    color: #555555; 
    vertical-align: middle; 
    -webkit-border-radius: 4px; 
    -moz-border-radius: 4px; 
    border-radius: 4px; 
} 

答えて

2

あなたが選択ボックスの要素に間隔をしたい場合は、選択ボックスの要素ではないのCSSを適用します。

選択ボックス要素は<option>

使用このCSSです

select option { 
    line-height: 20px; 
} 
関連する問題