I'm newish to HTML/CSS (~2 months overall) and stack overflow (first post). Using fontawesome.com my idea is to make this icon flip when the cursor hovers over it. The icon flips when the class includes 'fa-flip' and doesn't when it's not. So I was trying to change the class with hover. How can i fix this?
HTML:
<body>
<i class="fa-solid fa-user"></i>
</body>
CSS:
body[class="fa-solid fa-user fa-flip"]:hover
{<i class="fa-solid fa-user fa-flip"></i>}
I think the problem here is the class attribute is added to
<i>element, not<body>element.Could you try this?(I am assuming the element created by the fontawesome is
<i>)