Scholar Repository
Home>Manual>CSS :before pseudo-element

CSS :before pseudo-element

From http://www.w3schools.com (Copyright Refsnes Data)

CSS :before pseudo-element


CSS Reference Complete CSS Reference


Definition

The :before pseudo-element inserts some content before the content of an element.

Examples

The style below will play a sound before each occurrence of an <h1> element:

h1:before
{
content: url(beep.wav)
}



Try-It-Yourself Demos

Use :before to insert some content before the content of an element (Does not work in IE)
This example demonstrates how to use the :before pseudo-element to insert an image before the content of an element.


CSS Reference Complete CSS Reference

From http://www.w3schools.com (Copyright Refsnes Data)

Home>Manual>CSS :before pseudo-element