CSS :before pseudo-element

CSSWeb DevelopmentFront End Technology

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>
raja
Published on 30-Apr-2018 11:12:11
Advertisements