Image wont float to right

.img{
margin-top: 5%;
width: 360px;
height: 400px;
float: right;

}
.img{
margin-top: 5%;
width: 360px;
height: 400px;
float: right;

}
<img class="img" src="../Assets/game.gif" alt="This is an animated gif image">
<img class="img" src="../Assets/game.gif" alt="This is an animated gif image">
10 Replies
b1mind
b1mind2y ago
is it in a <p> ? You will need to provide the relationships around it (copepen is best) for us to understand
Aman
AmanOP2y ago
it was but i deleted it its not friend's code
b1mind
b1mind2y ago
few things.. Please look into how to properly use headings <h3> is not replacement for a <p> You need the img to be inside the <p> where you want to float it
b1mind
b1mind2y ago
Aman
AmanOP2y ago
I want the text to be on the left side and image on the right
b1mind
b1mind2y ago
then use grid or flex
Aman
AmanOP2y ago
i dont get why i need to put image inside <p>
b1mind
b1mind2y ago
because that is how float works, and what it was made for. don't use float for layout use grid or flex
Aman
AmanOP2y ago
Ok, Thanks a lot @b1mind
Want results from more Discord servers?
Add your server