Design comparison
Solution retrospective
I think i am having trouble with images all the time. Couldn't adjust text section height like %70 of the card because img height didn't reduce ( height = 100%
wasn't there at start ) Tried flex .3, max-height etc. Also couldn't find how to crop img either. Maybe overflow = hidden
would work normally but here i used flex.
Community feedback
- @ClaudiaRamirezDPosted about 2 months ago
Set the image container to have overflow: hidden, and the image should be styled with object-fit: cover to maintain the aspect ratio while filling the space: .article-preview__image { overflow: hidden; height: 200px; }
.article-preview__image img { width: 100%; height: 100%; object-fit: cover; } In this project I used SO MUCH the dev tools, don't be afraid to make mistakes and keep improving!
1@KapteynUniversePosted about 2 months ago@ClaudiaRamirezD Thanks for the feedback. Yea, i forgot to mention that. With that way whole article card height reduce (i think to balance the flex). This doesn't look bad tho, when i tried something like this, i didn't like the result. What was i tried to do just manipulate img while keeping the whole card.
0 - @Hasani-SediqaPosted 2 days ago
Hi @KapteynUniverse,
I hope you're doing well. I'm currently working on this project and facing some challenges with the social styling part. I've noticed that your work in this area is exceptional, and I admire your approach. I would like to ask for your permission to reference and follow your path to create my project better. Would it be possible for you to help me out?
Thank you in advance!
0@KapteynUniversePosted 2 days agoHey @Hasani-Sediqa, thanks, i hope you're doing well too. Sure, you can use the code or ask me anything. But i started to refactor some old codes recenty, probably i will change a few things on this one too.
1
Please log in to post a comment
Log in with GitHubJoin 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