Design comparison
Solution retrospective
Hello, i struggle a lot with reponsive in my projects, any help or advices would be welcome. Thank you!
Community feedback
- @HassiaiPosted over 1 year ago
There is no need to give the body a width and height value and there is no need to style the main.
Give the body a background-color.
There is no need to give .card a height value rather give desc-container a padding value for all the sides, this will replace the height, this will prevent the content from overflowing on smaller screens.
Give .card a max-width: 1440px and width:80% or width of 80vw instead of the percentage , you dont need to change theses values in the media query.
To center .card on the page using flexbox or grid, add min-height:100vh; display: flex; align-items: center: justify-content: center; or min-height:100vh; display: grid place-items: center to the body.
USING FLEXBOX: body{ min-height: 100vh; display: flex; align-items: center; justify-content: center; }
USING GRID: body{ min-height: 100vh; display: grid; place-items: 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
For the color of the image, a mix-blend-mode: multiply and opacity: 0.8 to the img instead of using filter.
img{ width: 100%; height: 100%; object-fit: cover; mix-blend-mode: multiply; opacity: 0.8; }
Hope am helpful.
Well done for completing this challenge. HAPPY CODING
Marked as helpful1 - @frank-itachiPosted over 1 year ago
Hello there π. Congratulation for completing the challengeπ!
I have some suggestions about your code that might interest you.
HTML π:
- Since the mobile design has a different image, you can use the
<picture>
tag that allows you to interchange the images depending of the viewport size. Red more about this awesome tag here. Take this as another way to do it.
I hope you find it useful! π Above all, you did a good job!
Happy
<coding />
π!Marked as helpful1 - Since the mobile design has a different image, you can use the
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