2014-12-05 61 views
-1

我已經制作了一個單選按鈕控件,它在Chrome中完美工作,但它不適用於Mozilla。盒子陰影樣式不應用於Mozilla中的單選按鈕

的HTML:

<input type='radio' class="myRadio" name='a' checked/><span> A</span> 
<br> 
<input type='radio' class="myRadio" name='a'/><span> B</span> 
<br> 
<input type='radio' class="myRadio" name='a'/> <span> C</span> 

的CSS:

input[type='radio'].myRadio { 
    -webkit-appearance:none; 
    width:20px; 
    height:20px; 
    border:1px solid darkgray; 
    border-radius:50%; 
    outline:none; 
    padding:0px; 
    -moz-box-shadow:0 0 5px 0px gray inset; 
    box-shadow:0 0 5px 0px gray inset; 
} 
input[type='radio'].myRadio:hover { 
    box-shadow:0 0 5px 0px orange inset; 
    -moz-box-shadow:0 0 5px 0px orange inset; 
} 
input[type='radio'].myRadio:before { 
    content:''; 
    display:block; 
    width:100%; 
    height:100%; 
    margin: 20% auto;  
    border-radius:50%; 
    margin-top:0px; 

} 
input[type='radio'].myRadio:checked:before { 
    background:orange; 
} 

Here is the jsfiddle

+0

你的意思是[urlencode](http://php.net/manual/en/function.urlencode.php)? – machineaddict 2014-12-05 09:11:05

+0

您是否允許配置文件中的allowed_uri_chars? – 2014-12-05 09:12:39

+1

請提供相關信息給我們 – 2014-12-06 11:58:54

回答

0

嘗試

-moz-appearance: none; 

顯然,你需要關閉默認的外觀設置,使box-shadow(不需要前綴)工作。

如果檢查用戶代理樣式規則(打開的選項「顯示瀏覽器的樣式」,「督察」下(齒輪)面板),你看

border: 2px inset #F0F0F0 !important; 

!important這裏迫使這種風格優先於你的,我試圖強制單選按鈕的「原生」外觀。您可能會在舊票中找到一些線索:https://bugzilla.mozilla.org/show_bug.cgi?id=605985

+0

你可以請我的CSS,因爲我還沒有得到它。 – Vishu238 2014-12-10 07:20:34

+0

此處未添加背景顏色 – Vishu238 2014-12-10 07:24:05