2017-04-04 92 views
-6

我試圖在菜單中心對齊文本,但它不起作用,而且懸停在菜單陰影上也不起作用。請問你有什麼解決方案?選擇菜單CSS

小提琴這裏:

https://jsfiddle.net/6towqd38/1/

CSS code 

    select { 
    border: 0 none; 
    color: black; 
    background: transparent; 
    font-size: 14px; 
    padding: 6px; 
    width: 100%; 
    *width: 100%; 
    *background: #58B14C; 
} 

#mainselection { 
    overflow: hidden; 
    width: 100%; 
    background: #4CAF50; 
    text-align: center; 
} 

#select:hover { 
    box-shadow: 0 0 20px blue; 
} 
+0

問題尋求幫助調試必須在這個問題本身要重現最短碼**注 - **請不要濫用代碼塊繞過這個要求**。 –

回答

0

這是你需要什麼?

select { 
 
    border: 0 none; 
 
    color: black; 
 
    background: transparent; 
 
    font-size: 14px; 
 
    padding: 6px; 
 
    width: 100%; 
 
    background: #58B14C; 
 
    text-indent: 50%; 
 
} 
 

 
#mainselection { 
 
    overflow: hidden; 
 
    width: 100%; 
 
    background: #4CAF50; 
 
    text-align: center; 
 
} 
 

 
select:hover { 
 
    text-shadow: 1px 1px red; 
 
    box-shadow:1px 1px red; 
 
}
<div id="mainselection"> 
 
    <select> 
 
    <option>Select options</option> 
 
    <option>1</option> 
 
    <option>2</option> 
 
    </select> 
 
</div>

0
select { 
    border: 0 none; 
    color: black; 
    background: transparent; 
    font-size: 14px; 
    padding: 6px; 
    width: 100%; 
    width: 100%; 
    background: #58B14C; 
    text-align: center; 
} 

option {text-align:center;} 

#mainselection { 
    overflow: hidden; 
    width: 100%; 
    background: #4CAF50; 
} 

select:hover { 
    text-shadow: 2px 2px 5px #00ff00; 
    box-shadow: 2px 2px 5px #555555; 
    }