简体   繁体   中英

Why are radio buttons and checkboxes so tiny in IE9?

微小的单选按钮和复选框

This is a screenshot from Bootstrap in IE9 but this seems to be the default. I don't understand why these controls are so tiny.

In IE6 to IE8 they are much larger and thus more clickable.

Any advice on making them larger using CSS only is appreciated.

I had the same problem with checkbox. We use bootstrap.css and there is the rule

input {
    box-sizing: border-box;
}

It caused to this problem in my case. So I add folowing style to my checkbox and it solved the issue:

.my-class input {
    box-sizing: content-box;
}

Hope it will help somebody.

You can resize both radio buttons and checkbox's with the help of scale function.

CSS Code:

input[type=radio],input[type=checkbox] { 
-ms-transform:scale(2,2);
transform: scale(2, 2); 
-moz-transform: scale(2, 2); 
-webkit-transform: scale(2, 2); 
-o-transform: scale(2, 2); 
}

Sample JS Fiddle

Checkboxes/Radio Groups... generally fail to resize in cross browser support.. Without playing around with them quickly.. I do recall this was always a pain in the ###..

Personally i would suggest finding a replacement element for them, this is why there are so many packages out there that support graphical versions of them.

While using transform/height/width will work in some cases... You will still end up with certain browsers failing to adjust them. So it could be that your page has a generally larger scale but they fail to scale.

Not ideally a good answer, but this goes from past experiences.

None of the solutions found so far were working in IE9 here. I finally found mention of the \\ ; hack and tried it. Presto!

/* IE9 */
:root input#my-checkbox {
    width:20px !important \ ;
    height:20px !important \ ;
    box-sizing:content-box !important \ ;
}

This may also affect checkboxes in IE8? IE10? but we have separate conditionals for those anyway.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM