0
我需要改變選擇選項懸停背景顏色只使用CSS。如何更改選擇選項懸停背景顏色只使用CSS?
Please check the link : https://jsfiddle.net/bilashcse/k2o783rp/
我的代碼:
HTML:
<div>
<select>
<option>Apples</option>
<option selected>Pineapples</option>
<option>Chocklate</option>
<option>Pancakes</option>
</select>
</div>
CSS:
select {
margin: 50px;
border: 1px solid #111;
background: transparent;
width: 150px;
padding: 5px 35px 5px 5px;
font-size: 16px;
border: 1px solid #ccc;
height: 34px;
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;
background: url(http://www.stackoverflow.com/favicon.ico) 96%/15% no-repeat #eee;
}
select option:hover{
background:red !important;
}
可能的重複http://stackoverflow.com/questions/10484053/change-select-list-option-background-colour-on-hover – Sumit
你想讓整個紅色像這樣?:https:// jsfiddle.net/k2o783rp/1/ –