Computer >> Computer tutorials >  >> Programming >> CSS

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

<html>
   <head>
      <style>
         p:before
         {
            content: url(/https/www.wsxdn.com/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>