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

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

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

14条回答
  •  挽巷
    挽巷 (楼主)
    2020-11-28 06:55

    Resizing the default widget doesn’t work in all browsers, but you can make custom radio buttons with JavaScript. One of the ways is to create hidden radio buttons and then place your own images on your page. Clicking on these images changes the images (replaces the clicked image with an image with a radio button in a selected state and replaces the other images with radio buttons in an unselected state) and selects the new radio button.

    Anyway, there is documentation on this subject. For example, read this: Styling Checkboxes and Radio Buttons with CSS and JavaScript.

提交回复
热议问题