Généralement utilisé pour ajouter du contenu esthétique à un élément via la propriété CSS content.

Note: IE8 and Opera 4-6 only support the old, single-colon CSS syntax (:before). Newer versions support the standard, double-colon CSS syntax (::before). This is not due to input tags not having any content per-se, but that their content is outside the scope of CSS.. input elements are a special type called replaced elements, these do not support :pseudo selectors like :before and :after.. For me the problem was that after did not work on an image tag – Simon Ludwig May 23 at 22:37. add a comment | 1 Answer Active Oldest Votes.

joined:Apr 9, 2011 posts:16245 votes: 1029. Tutorials, references, and examples are constantly reviewed to avoid errors, but we cannot warrant full correctness of all content. Examples might be simplified to improve reading and basic understanding. Par défaut, l'élément créé est de type en-ligne (inline).

Insert some text before the content of each

element:The numbers in the table specifies the first browser version that fully supports the selector.Insert content before every

element's content, and style the inserted content:If you want to report an error, or if you want to make a suggestion, do not hesitate to send us an e-mail: CSS Syntax::before { css declarations;} More Examples.

Example. li.right-course:before {position: absolute; top: 0; left: 0; font-family: FontAwesome; content: "\f00c"; color:#f16924; } What can I do to have the :before work only on this class? Ce tableau de compatibilité a été généré à partir de données structurées.

While using this site, you agree to have read and accepted our I tried this and it did not work.

Si vous souhaitez contribuer à ces données, n'hésitez pas à envoyer une e à le faire après votre première connexion.

Note: For :before to work in IE8, a must be declared. While the end result is not actually in the DOM, it appears on the page as if it is, and would essentially be like this: div::before { content: "before"; } div::after { … You don't seem to be using a pseudo-element at the moment. lucy24. The ::before and ::after pseudo-elements in CSS allows you to insert content onto a page without it needing to be in the HTML. W3Schools is optimized for learning, testing, and training.

Msg#:4793791 . 46. 2:53 am on Mar 1, 2016 (gmt 0) Senior Member from US . ::before crée un pseudo-élément qui sera le premier enfant de l'élément ciblé.