CSS :before pseudo-element



Use this element to insert some content before an element. The following example demonstrates how to use the :before element to add some content to any element.

Example

Live Demo

<html>
   <head>
      <style>
         p:before
         {
            content: url(/images/bullet.gif)
         }
      </style>
   </head>
   <body>
      <p> This line will be preceded by a bullet.</p>
      <p> This line will be preceded by a bullet.</p>
      <p> This line will be preceded by a bullet.</p>
   </body>
</html>

Advertisements