How to change the size of the radio button using CSS?

前端 未结 14 1674
野的像风
野的像风 2020-11-28 06:17

Is there a way to control the size of the radio button in CSS ?

14条回答
  •  一向
    一向 (楼主)
    2020-11-28 06:54

    This css seems to do the trick:

    input[type=radio] {
        border: 0px;
        width: 100%;
        height: 2em;
    }
    

    Setting the border to 0 seems to allow the user to change the size of the button and have the browser render it in that size for eg. the above height: 2em will render the button at twice the line height. This also works for checkboxes (input[type=checkbox]). Some browsers render better than others.

    From a windows box it works in IE8+, FF21+, Chrome29+.

提交回复
热议问题