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


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM