Blog Preview Card Solution using Plain HTML and CSS
Design comparison
Community feedback
- @AdrianoEscarabotePosted about 2 months ago
Hey Hrid Chakraborty, how’s it going? I was really impressed with your project’s result, though I have some advice that could be helpful:
Using only
<div>
to structure your code, as in the example below, can be problematic for both accessibility and HTML semantics. Whilediv
elements are generic containers, they don’t provide meaning to the content. This can make it harder for screen readers and accessibility tools to understand and present the content correctly.This code lacks semantic tags such as
header
,article
,section
,time
, andfooter
, which help organize and provide meaning to the content. Using these tags improves accessibility, SEO, and makes the code easier to maintain and understand.Example with semantic tags:
<article class="container"> <img src="assets/images/illustration-article.svg" alt="blog-illustration" /> <header> <span class="blog-tag">Learning</span> <time class="publish-date" datetime="2023-12-21">Published 21 Dec 2023</time> </header> <h1 class="blog-title">HTML & CSS foundations</h1> <p class="blog-desc"> These languages are the backbone of every website, defining structure, content, and presentation. </p> <footer class="blog-author"> <img src="assets/images/image-avatar.webp" alt="Author face" /> <span class="blog-author-name">Greg Hooper</span> </footer> </article>
In this example, semantic tags like
article
,header
,time
, andfooter
help describe the content clearly and accessibly. This improves the navigation experience for everyone, especially for people using assistive technologies.Everything else looks great.
Hope this helps! 👍
Marked as helpful1@hrid-chakrabortyPosted about 1 month ago@AdrianoEscarabote Thank you so much for your feedback
1
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