admin管理员组文章数量:1304154
I want to keep default browsers appearances for all input elements I want only increase the size of the radio buttons (no jQuery,no bg image,etc) only with simple CSS.
I use this simple CSS code:
.bigradio{ width: 2em; height: 2em;}
Which is working only under IE and Chrome, other major browsers (FF,Opera,Safari) don't want to increasing default radio button size :(
Please help, I need a simple and clean CSS cross browser solution (no jQuery, no hiding default appearance, etc)
Thanks,
I want to keep default browsers appearances for all input elements I want only increase the size of the radio buttons (no jQuery,no bg image,etc) only with simple CSS.
I use this simple CSS code:
.bigradio{ width: 2em; height: 2em;}
Which is working only under IE and Chrome, other major browsers (FF,Opera,Safari) don't want to increasing default radio button size :(
Please help, I need a simple and clean CSS cross browser solution (no jQuery, no hiding default appearance, etc)
Thanks,
Share Improve this question edited Apr 3, 2014 at 0:35 Jatin 3,0896 gold badges30 silver badges42 bronze badges asked Apr 3, 2014 at 0:22 noeh888noeh888 411 gold badge3 silver badges6 bronze badges 1- possible duplicate of How to change the size of the radio button using CSS? – random_user_name Commented Apr 3, 2014 at 0:23
2 Answers
Reset to default 4Here's a FIDDLE
<input id="radio1" type="radio" name="radio"><label for="radio1" class="radio">Radio 1</label>
<input id="radio2" type="radio" name="radio"><label for="radio2" class="radio">Radio 2</label>
<input id="radio3" type="radio" name="radio"><label for="radio3" class="radio">Radio 3</label>
.radio {
position: relative;
float: left;
clear: left;
display: block;
padding-left: 40px;
margin-bottom: 12px;
line-height: 22px;
font-size: 18px;
color: #666;
cursor: pointer;
}
.radio:before {
background: #fff;
content: "";
position: absolute;
display: inline-block;
top: 0;
left: 0;
width: 22px;
height: 21px;
border: 1px solid #bbb;
border-radius: 100%;
-moz-border-radius: 100%;
-webkit-border-radius: 100%;
box-shadow: inset 0 0 3px 0 #ccc;
-moz-box-shadow: inset 0 0 3px 0 #ccc;
-webkit-box-shadow: inset 0 0 3px 0 #ccc;
}
input[type="radio"] {
display: none;
}
input[type="radio"]:checked + label:before {
content: "\2022";
text-align: center;
line-height: 15px;
font-family: Tahoma; /* If you change font you must also change font-size & line-height */
font-size: 44px;
color: #00a0db;
text-shadow: 0 0 4px #bbb;
}
Have you tried this?
input[type=radio] {
transform: scale(3, 3);
-moz-transform: scale(3, 3);
-ms-transform: scale(3, 3);
-webkit-transform: scale(3, 3);
-o-transform: scale(3, 3);
}
JSFiddle
Keep in mind that this will scale the button without affecting the layout around it, i.e. nothing around it will move because of it, so use appropriate margins, paddings, etc.
本文标签:
版权声明:本文标题:javascript - html - how to increase radio buttons size under Firefox,Opera,Safari - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741780544a2397282.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论