@gmagnenat
Posted
Hi, congrats on completing the project.
I’ve reviewed your code and have a few suggestions to help you improve it:
Accessibility and Structure:
-
Main Landmark: The
<main>
element should be the parent of your card, not the card itself. Also, you don’t need to addrole="main"
to the<main>
element as it is already recognized as the main content landmark. -
Alt Attribute: Avoid using "image" in the
alt
attribute of your images. Instead, describe what the image represents or its function. This makes it easier for users with screen readers to understand the content.
CSS and Layout:
-
Use a CSS Reset: Your stylesheet should include a modern CSS reset at the beginning. This helps ensure that your design looks consistent across different browsers.
-
Min-Height on Body: Instead of using a fixed height for the body, use
min-height
. This allows the body to expand with the content and provides a better experience as content grows. -
Font Sizes in Pixels: Never use pixels for font sizes. Use relative units like
rem
orem
to ensure that text scales properly with user settings and devices.
Maintainability:
- Use Classes for Styling: Rather than styling HTML elements directly, use classes. This makes your code more maintainable and flexible. For example, use a class like
.heading
instead of stylingh1
directly. This way, if you decide to change the HTML tag, you won’t need to update your CSS selectors.
I hope these tips help you improve your project. If you have any questions or need more details, just let me know!
Happy coding!