Responsive Article Preview Component

Please log in to post a comment
Log in with GitHubCommunity feedback
- @MBaktygul
Hello there 👋 I have some suggestions about your code that might interest you:
I suggest you add
object-fit: cover;
. It ensures that the image maintains its aspect ratio and fills the container without being squished.And
object-position: left;
. It aligns the focal point of the image to match the design better.Here’s your improved CSS:
.left img { border-top-left-radius: 10px; border-bottom-left-radius: 10px; width: 100%; height: 100%; object-fit: cover; /* Prevents image distortion */ object-position: left; /* Aligns the image properly */ }
Keep up the great work 🎉
Happy coding! 🚀
Join our Discord community
Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!
Join our Discord