Is the :before pseudo-element allowed on an input[type=checkbox]?

后端 未结 3 673
再見小時候
再見小時候 2020-11-28 15:53

This StackOverflow answer describes how to style checkboxes using CSS3 without requiring a :

input[type=checkbox]:before {
    cont         


        
3条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-11-28 16:28

    I think that Chrome's behavior is invalid. If you take a look here, it says the ::before and ::after pseudo elements add new content before or after the target element's content. Input elements have no content; they just have a value. You can't, for instance, do Pasta.

    If all of this is true, then it would seem that Chrome's behavior is invalid, whereas IE and Firefox are correct.

提交回复
热议问题