
Design comparison
SolutionDesign
Community feedback
- P@kaamiikPosted 28 days ago
Hi. I see some issues in your code I wanna mention:
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 decorative and avatar images, use empty alt text:
alt=""
- Avoid using words like image, picture, or photo in alt descriptions
- The "Learning" text should not be a
<span>
- it should be a<p>
tag. The person name is a<p>
tag too.
- Elements with hover effects are considered interactive
- If an element with hover effects navigates to a new page, wrap it in an
<a>
tag. Here yourh2
is interactive too. So you need to wrap it inside thea
tag:
<h2><a href="#">Title Text</a></h2>
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; }
- Avoid fixed widths for text containers:
- Remove
width: 300px
from.card
- Use
max-width
for better text container adaptability
- Remove
- Use relative units:
rem
forfont-size
andmax-width
instead ofpx
- Learn more about this here
0 - A proper page structure inside
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