CSS checkboxes & radio buttons when input is inside label?

后端 未结 4 991
清歌不尽
清歌不尽 2021-02-01 14:52

I\'ve searched extensively on here for an answer to this but haven\'t quite come across what I\'m looking for. Found this CSS - How to Style a Selected Radio Buttons Label? but

4条回答
  •  死守一世寂寞
    2021-02-01 15:12

    Unfortunately CSS doesn't allow the styling of parent elements based on child elements which would be the easy way example:

    div.a < div { border: solid 3px red; }
    

    The opposite of selecting a child based on parent:

    div.a > div { border: solid 3px red; }
    

    What you are wanting to do can be achieved using jQuery.

    Check out this post.

提交回复
热议问题