I searched ::before
and ::after
up, and I understand that HTML is not rendered inside of the pseudo-elements. I have a Unicode character(Ξ) before and after a certain text element, and I would like to animate them, and only those characters. Is there a trick to inserting HTML elements into ::before
and ::after
elements or animating only those elements? Or should I just separately insert them into the code and animate them separately?
My current code:
.side div h2::before {
content: "Ξ";
animation: spin 3s infinite;
}
.side h2::after {
content: "Ξ";
animation: spin 3s infinite;
}
@keyframes spin {
0% {
transform: rotate(0deg);
}
50% {
transform: rotate(180deg);
}
100% {
transform: rotate(360deg);
}
}
<div class="side">
<div style="height:100%;">
<h2>Navigation</h2>
</div>
</div>