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

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

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

14条回答
  •  悲&欢浪女
    2020-11-28 07:06

    Yes, you should be able to set its height and width, as with any element. However, some browsers do not really take these properties into account.

    This demo gives an overview of what is possible and how it is displayed in various browsers: https://www.456bereastreet.com/lab/styling-form-controls-revisited/radio-button/

    As you'll see, styling radio buttons is not easy :-D

    A workaround is to use JavaScript and CSS to replace the radio buttons and other form elements with custom images:

    • https://github.com/emblematiq/Niceforms
    • https://web.archive.org/web/20161119112447/http://ryanfait.com/resources/custom-checkboxes-and-radio-buttons/

提交回复
热议问题