Blog preview card challenge

Solution retrospective
Big thanks to @Islandstone89 for the super helpful feedback on my first project! I’m most proud that I was able to apply that feedback—not just to the previous project, but also to this one. I really tried to carry over those best practices and improve overall quality.
What challenges did you encounter, and how did you overcome them?I learned that img tags are inline elements by default, which can cause unexpected whitespace gaps in the layout. These gaps aren’t always obvious in developer tools, which makes debugging tricky. I fixed it by setting display: block; on the images.
Another thing I discovered: Flexbox’s default align-items value is stretch, which made some elements take up more space than intended. Setting align-items: flex-start; gave me the alignment I actually wanted.
What specific areas of your project would you like help with?- How can I avoid unnecessary styles in my CSS file?
- How do you usually handle fonts? My font setup ends up using a lot of lines.
- What’s the best way to deal with different font sizes or styles on mobile/desktop? Do you rely on media queries or is there a cleaner way?
Please log in to post a comment
Log in with GitHubCommunity feedback
- P@Islandstone89
Well done once again!
A few suggestions:
HTML:
-
Instead of having a background image in
.image-container
, I would remove that<div>
and place the image in the HTML:<img src="assets/images/illustration-article.svg" alt="">
-
I would wrap the date in the
<time>
element:<p class="text-preset-3>Published <time datetime="2023-12-21">21 Dec 2023</time></p>
.
CSS
-
Remove
font-size: 62.5%
onhtml
,as changing the font size is bad for accessibility. You'll need to adjust your font sizes in the Custom Properties. -
On the
body
, changepadding-inline
topadding
- without padding at the top and bottom, the card squeezes against the edges. -
max-inline-size
on the card should be inrem
, for example20rem
. You don't need to use themin()
function, and it's not recommended to use%
for properties likeinline-size
,margin
,padding
orborder-radius
. -
Media queries should be in
rem
orem
instead ofpx
.
Marked as helpful -
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