Click here to Skip to main content
15,878,809 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I downloaded this free icon from fontawesome.com and it's static, it doesn't want to move, how can I fix this?
HTML
<head>
<script src="https://kit.fontawesome.com/d1950e8188.js" crossorigin="anonymous"></script>
  class="fa-solid fa-cart-shopping">
</head>


What I have tried:

CSS
i {
  text-align: center;
}
Posted
Updated 2-Jul-22 11:32am
Comments
Maciej Los 2-Jul-22 15:10pm    
You html code is NOT well formed.
Duran Duran Duran 2-Jul-22 15:17pm    
why do you say so?
Maciej Los 2-Jul-22 15:25pm    
This piece of code is out of context:
class="fa-solid fa-cart-shopping">
Dave Kreskowiak 2-Jul-22 16:07pm    
A class attribute must be part of an HTML element, which you did not specify. This is illegal:
    class="fa-solid fa-cart-shopping">

The start of the element is missing, and I'll assume you want this on an image tag:
    <img class="fa-solid fa-cart-shopping">

1 solution

Quote:
Why is this icon not moving?
i {
text-align: center;
}
Maybe icons don't obey text commands...

Have a look here: CSS: centering things[^]

:)
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900