Sử dụng phần tử này để chèn một số nội dung trước một phần tử. Ví dụ sau minh họa cách sử dụng phần tử:before để thêm một số nội dung vào bất kỳ phần tử nào.
Ví dụ
<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>