缩放单选按钮

时间:2014-09-23 14:07:22

标签: css firefox

我需要帮助缩放单选按钮。 Chrome和IE11使用转换,缩放工作正常。然而,Firefox的边界模糊,看起来很可怕。任何帮助都会很棒!

    p { float: left; margin: 5px }

    input {
        -moz-transform: scale(1.6, 1.6);
        -ms-transform: scale(1.6, 1.6);
        -o-transform: scale(1.6, 1.6);
        -webkit-transform: scale(1.6, 1.6);
        transform: scale(1.6, 1.6);
    }
    <p><input type="radio" name="foo"></p>
    <p><input type="radio" name="foo"></p>

http://jsfiddle.net/applesElmi/ueafvmcx/

谢谢!

1 个答案:

答案 0 :(得分:1)

不同的网络浏览器有不同的渲染引擎和解析方法......如果你想让它在FF上工作,请不要使用规模...尝试不同的方法或等待FF更新来解决这个问题。

这里有一个很好的教程,介绍如何自定义复选框/单选按钮:http://www.hongkiat.com/blog/css3-checkbox-radio/

HTML

<div class="radio">  
    <input id="male" type="radio" name="gender" value="male">  
    <label for="male">Male</label>  
    <input id="female" type="radio" name="gender" value="female">  
    <label for="female">Female</label>  
</div> 

CSS

label {  
    display: inline-block;  
    cursor: pointer;  
    position: relative;  
    padding-left: 25px;  
    margin-right: 15px;  
    font-size: 13px;  
} 

input[type=radio] {  
    display: none;  
}  


label:before {  
    content: "";  
    display: inline-block;  

    width: 16px;  
    height: 16px;  

    margin-right: 10px;  
    position: absolute;  
    left: 0;  
    bottombottom: 1px;  
    background-color: #aaa;  
    box-shadow: inset 0px 2px 3px 0px rgba(0, 0, 0, .3), 0px 1px 0px 0px rgba(255, 255, 255, .8);  
}