Design comparison
Solution retrospective
Just a quick exercise to practice React and TypeScript.
Community feedback
- @AGutierrezRPosted 11 months ago
Hello there 👋. Good job on completing the challenge!
I have some suggestions about your code that might interest you.
General Structure and HTML:
- Consider using
<span>
or<time>
instead of paragraphs for elements that are not actual paragraphs like ”Published...”. - Consider using
<div>
instead of a paragraph for the bottom element (pic + name).
Accessibility and Semantic HTML:
- The icons/illustration images are decorative, so their alt text must be empty:
alt=""
. - Profile image could benefit from a more descriptive alt text, like
alt="Headshot of Greg Hooper"
. - Maintain semantic HTML structure by using appropriate elements for their intended purposes.
I hope you find this helpful 😁. Most importantly, your submitted solution is fantastic!
Happy coding!
0@joshjavierPosted 11 months agoThanks for the feedback @AGutierrezR 🙂
Re: using
<div>
or<span>
instead of<p>
, in my opinion that would be less semantic, since divs and spans are non-semantic elements. According to MDN, HTML paragraphs aren't limited to actual paragraphs, but "can be any structural grouping of related content, such as images or form fields."Therefore, using
<p>
in this case is fine for structuring the metadata elements (publish date and byline).I did wrap my date in a
<time>
element to make it machine-readable and more accessible (e.g. to search engines).As for the avatar, I decided to leave the alt tag empty, otherwise screen readers would read it as "Headshot of Greg Hooper, Greg Hooper". Though I might try putting a visually hidden text such as "Written by" before the author's name to improve screen reader experience.
0 - Consider using
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