.box {
position: relative;
}
.box:hover:before {
content: "Before content";
}
.box:hover:after {
content: "After content";
}
The above CSS code example creates a class called "box" and gives it a relative position. Then, it says that when the user hovers over the element with the class "box", the content before and after the element will change to "Before content" and "After content", respectively.
0 Comments