Responsive Blog Preview Card

Solution retrospective
When I was pushing to Git, I kept making mistakes on the README.md file and had to keep repeating the process of git add, git commit and git push. I have now gotten it to read the way I want it to. The problems originated from using the wrong file paths for the README.md file and my project's screenshot initially.
Please log in to post a comment
Log in with GitHubCommunity feedback
- P@kaamiik
Hi. Some notes for your code:
HTML
- A proper page structure inside
<body>
should look like this:
<body> <header>...</header> <main>...</main> <footer>...</footer> </body>
Since this is a card component, we only need the
<main>
element.
- For
<img>
tag you need alt text to describe the image. Although for decorative and avatar images You need to add an emptyalt=""
because there is no information in the photo. The point is you have to usealt
.
- Follow proper heading hierarchy:
- Each page should have one
<h1>
- For components that are part of a larger page, use
<h2>
instead - This maintains proper document structure while reflecting component hierarchy
- Each page should have one
- You do not need to wrap the person name into a
<span>
. Simply use ap
tag.
CSS Best Practices
- Start with a proper CSS reset (Andy Bell or Josh Comeau resets are recommended)
-
Use viewport height properly:
/* Instead of: */ body { height: 100vh; } /* Use: */ body { min-height: 100vh; }
This ensures content can expand beyond viewport height
- Avoid fixed widths and height for text containers:
- Remove
width: 384px
andheight: 522px
from.wrapper
- Use
max-width
for better text container adaptability
- Remove
- Use relative units:
rem
forfont-size
andmax-width
instead ofpx
- Learn more about this here
- Follow mobile-first approach:
- Start with mobile styles as the default
- Use
min-width
in media queries - Use
em
units for breakpoints
Example media query:
@media (min-width: 40em) { /* Desktop styles */ }
- A proper page structure inside
- @Stash443
The solution was well built, as well as the responsive(media query) part was well structured and understandable. I don't see any improvements that need to be implemented here. Well done.
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