Design comparison
Community feedback
- @MelvinAguilarPosted almost 2 years ago
Hello there 👋. Good job on completing the challenge !
I have some feedback for you if you want to improve your code.
Grid:
-
You are using the wrong layout for this challenge, instead of using flexbox you should use a grid layout. Grid layouts are better suited for this challenge because they allow you to create complex layouts with multiple columns and rows. They also provide more control over the positioning of elements, which is important when creating a responsive design.
You can view a simple and not accesible demonstration of this code on Codepen at the following link: https://codepen.io/melvinhdev/pen/qBKNLJr
HTML 📄:
- Use the
<main>
tag to wrap all the main content of the page instead of the<div>
tag. With this semantic element you can improve the accessibility of your page.
- You must use a level-one heading (h1) even though this is not a full-page challenge. You can create an '<h1>' element within your 'main' element that will be hidden visually but visible and readable by screen readers. The class "sr-only" hides content visually and here are the styles to copy. e.g.:
<h1 class="sr-only">Testimonials grid section</h1>
-
The
alt
attribute should not contain the words "image", "photo", or "picture", because the image tag already conveys that information.If you want to learn more about the
alt
attribute, you can read this article. 📘.
-
To improve the semantics of your code you should use the
<figure>
and<blockquote>
tags to wrap the testimonials, with this, you will be able to encapsulate the author and the citation of the testimonial.Example:
<figure> <blockquote> <p>"Example of a testimonial"</p> </blockquote> <figcaption> <p>Example of the author</p> </figcaption> </figure>
You can read more about the
<figure>
and<blockquote>
tags with this two links:
CSS 🎨:
- Instead of using pixels in font-size, use relative units like
em
orrem
. The font-size in absolute units like pixels does not scale with the user's browser settings. This can cause accessibility issues for users who have set their browser to use a larger font size. You can read more about this here 📘.
- To center the component in the page, you should use Flexbox or Grid layout. You can read more about centering in CSS here 📘.
body { min-height: 100vh; display: flex; justify-content: center; align-items: center; }
I hope you find it useful! 😄 Above all, the solution you submitted is great!
Happy coding!
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