Design comparison
Solution retrospective
I can't achieve what i want with flexbox so I use CSS grid to layout the content also to help with the responsiveness for mobile view.
Community feedback
- @MelvinAguilarPosted almost 2 years ago
Hello again ! ๐. Good job on completing the challenge !
I have other suggestions about your code that might interest you.
HTML ๐:
- Using grid to create the two columns is the most indicated in this challenge, and understanding it on your first try is admirable, congratulations!
- The product image is not a decoration. You must not use the background-image property to add the product image. Instead, use the
<img>
tag to add the image. Use the background-image property only for decorative images that do not add any information to the page.
-
You can use the
<picture>
tag when you have different versions of the same image ๐ผ. Using the<picture>
tag will help you to load the correct image for the user's device saving bandwidth and improving performance. You can read more about this here ๐.Example:
<picture> <source media="(max-width: 600px)" srcset="./images/image-product-mobile.jpg"> <img src="./images/image-product-desktop.jpg" alt="{your alt text goes here}"> </picture>
I hope you find it useful! ๐
Happy coding!
Marked as helpful1 - @HassiaiPosted almost 2 years ago
Replace<div class="container">with the main tag, <p> in <div class="brand-tittle"> with h1, <h4> with <p> and <div class="attribution"> with the footer tag to fix the accessibility issues. click here for more on web-accessibility and semantic html
To center .container on the page using flexbox, add justify-content: center and aalign-items: center to the body.
To center .container on the page using flexbox: body{ min-height: 100vh; display: flex; align-items: center; justify-content: center; }
Use relative units like rem or em as unit for the padding, margin, width values and preferably rem for the font-size values, instead of using px which is an absolute unit. For more on CSS units Click here
Hope am helpful.
Well done for completing this challenge. HAPPY CODING
Marked as helpful0
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