How can I hide a checkbox in html?

前端 未结 6 1009
孤街浪徒
孤街浪徒 2020-12-29 04:49

I want to hide a checkbox.
But also want that, when I click on label associated with corresponding checkbox, the checkbox should

6条回答
  •  醉酒成梦
    2020-12-29 05:13

    You need to add the element type to the class, otherwise it will not work.

    .hide-checkbox { display: none }        /* This will not work! */
    input.hide-checkbox { display: none }   /* But this will. */ 
    
    

    It looks too simple, but try it out!

提交回复
热议问题