Easy Tutorial
❮ Css3 Pr Animation Keyframes Css3 Pr Border Bottom Right Radius ❯

CSS :before Selector

Complete CSS Selector Reference

Example

Insert content before each <p> element:


Definition and Usage

The :before selector inserts content before the selected element.

Use the content property to specify the content to be inserted.


Browser Support

The numbers in the table specify the first browser version that fully supports the property.

Selector
::before 4.0 9.0 <br> partial from 8.0 3.5 3.1 7.0 <br> partial from 4.0

Note: :before works in IE8, but you must declare <!DOCTYPE>.


Related Articles

CSS Tutorial: CSS Pseudo-elements

CSS Selector Reference: CSS :after Selector


More Examples

Example

Insert and style content before each <p>:


❮ Css3 Pr Animation Keyframes Css3 Pr Border Bottom Right Radius ❯