Hide check radio button with css

前端 未结 7 862
一向
一向 2020-12-25 13:00

I would like to know if it is possible to hide the checked radio button with css by using:

  { display:none; }

I don\'t know how to address

7条回答
  •  春和景丽
    2020-12-25 13:50

    Just a little tip:

    If you still want to use all the browser's native support for radios and check boxes, like moving between them with ↑ and ↓ keys, set the css to:

    position: fixed;
    opacity: 0;
    pointer-events: none;
    

    This will keep all functionality but keep the input hidden, and won't take up any layout space.
    I've spent the last 3 hours figuring this out, but it does work!

提交回复
热议问题