CSS :before pseudo-element

CSS :before Pseudo-Element

Description

The :before pseudo-element is used to insert content before an element.

Example

The following example demonstrates how to use the :before element to add content before any element.

<html> 
<head> 
<style type = "text/css"> 
p:before { 
content: url(/https://coder-cafe.com/wp-content/uploads/2025/09/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> 

This will produce the following black link –


CSS :before pseudo-element

Leave a Reply

Your email address will not be published. Required fields are marked *