Which element is used to insert some content before an element with CSS

CSSWeb DevelopmentFront End Technology

Use the :before element to insert some content before any element. 

Example

You can try to run the following code to insert some content before an element with CSS −

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 27-Apr-2018 09:40:43
Advertisements