Submitted 7 months ago
Responsive blog preview card
#accessibility#bem
P
@IEdiong
Design comparison
SolutionDesign
Community feedback
- @josemguerraPosted 22 days ago
Feedback for Blog Preview Card Code
1. Semantic HTML
- Strengths:
- Use of
<header>
,<main>
,<article>
, and<footer>
tags enhances the semantic structure of the document. - Including an
<h1>
within the<header>
(even as screen reader-only) ensures accessibility.
- Use of
- Improvements:
- Consider adding a descriptive
alt
attribute for the article illustration image (alt=""
). An emptyalt
is only appropriate when the image is purely decorative. - The
<a>
tag inside the<h2>
could usearia-label
for additional accessibility if it links to specific content beyond what the title conveys.
- Consider adding a descriptive
2. Accessibility
- Strengths:
- The use of
sr-only
for the<header>
improves screen reader accessibility. - Including
alt
text for the avatar image ensures it is accessible to assistive technologies.
- The use of
- Improvements:
- Use a more descriptive
alt
text for the avatar image (e.g., "Author Greg Hooper's profile picture") to provide meaningful context.
- Use a more descriptive
3. Responsive Design
- Strengths:
- The structure of the HTML is well-suited for responsive layouts with proper containerization (
main.container
andarticle.card
).
- The structure of the HTML is well-suited for responsive layouts with proper containerization (
4. Code Structure, Readability, and Reusability
- Strengths:
- The HTML is clean, well-structured, and easy to read.
- Proper usage of class naming conventions like
card__img
andcard__footer
suggests adherence to a BEM-like methodology.
- Improvements:
- Consider adding comments to clarify the purpose of each section for future maintainers.
5. Consistency with Design
- Strengths:
- The structure of the card matches the expected layout based on the title and visual hierarchy.
Summary of Suggestions:
- Add descriptive
alt
text for images and verify sufficient color contrast. - Add comments for maintainability and improve accessibility with
aria-label
where necessary.
Overall, the code is well-structured and shows a good understanding of semantic HTML and accessibility principles. Great job!
0 - Strengths:
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