input标签不支持伪元素!

规范里说:

Authors specify the style and location of generated content with the :before and :after pseudo-elements. As their names indicate, the :before and :after pseudo-elements specify the location of content before and after an element's document tree content. The 'content' property, in conjunction with these pseudo-elements, specifies what is inserted.
作者用:before和:after伪元素指定生成的内容的样式和位置。如其名所示,:before和:after伪元素指定了一个元素文档树内容之前和之后的内容。'content'属性,与这些伪元素联用,指定了插入的内容。

按照我的理解是: 伪元素是在容器内渲染的,如果标签元素里面不能插入标签元素,像img,input等单标签或者radio此类标签,这些不支持伪元素

解决方法: 可以在使用的时候在外面套一层div

posted @ 2019-11-03 00:32  zoo-x  阅读(1903)  评论(0编辑  收藏  举报