The `::after` pseudo-element in CSS is used to insert content after the content of an element. The generated content is “virtual” in the sense that it does not actually exist in the document tree. Instead, it’s a decorative content added from the CSS and is not in the actual HTML.
Here’s how to use the `::after` pseudo-element:
1. Select the element where you want to insert something after the content.
```
div::after
```
1. Specify the `content` property. Remember, this property is mandatory with `::after`, otherwise nothing will be generated.
```
div::after {
content: “”;
}
```
1. You can insert text, an image, or any allowed value with `content`.
```
div::after {
content: “ (This text is inserted after the div element’s content)”;
}
div::after {
content: url(image.jpg);
}
```
1. Other CSS properties can be used to style this added content.
```
div::after {
content: “ (This text is inserted after the div element’s content)”;
color: red;
font-style: italic;
}
```
The `::after` pseudo-element is inline by default, so you can also set other properties like `display: block;` or `display: inline-block;` etc., to control its layout.
Remember, the content generated by `::after` is not selectable and not accessible by screen readers. It’s best used for decorative content. If the content is meaningful, it’s recommended to put it in the HTML instead.