Hide check radio button with css

前端 未结 7 907
一向
一向 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:46

    Additional to Nathan Lee answer

    input[type="radio"]:checked{
        visibility:hidden;
    }
    

    is an option to specify a checked radio button

    input[type="radio"][value="text"]:checked{
        visibility:hidden;
    }
    

    is an option to specify a checked radio button with a value that equals 'text' ('none' in your example)

    more info: https://developer.mozilla.org/en-US/docs/Web/CSS/Attribute_selectors

    if the value is not know, some jQuery can do the trick: http://api.jquery.com/attribute-equals-selector/

提交回复
热议问题