Design comparison
Solution retrospective
I had trouble trying to write media queries and keeping things aligned when i stretched the website for the desktop design. Things kept breaking and i tried to fix everything in the best way i could, but it's far from good. Any help ?
( Sorry if i misspell or wrote something in a weird way. I'm a beginner English student and i'm still figuring things out. Thanks for the patience. )
Community feedback
- @AdrianoEscarabotePosted about 2 years ago
Hi graple-guillos, how are you?
I really liked the result of your project, but I have some tips that I think you will enjoy:
A good practice to center content is using
grid
orflex-box
, avoid using margin or padding to make placements, use only in the latter case! we can do it like this:Flex-box:
body { display: flex; align-items: center; justify-content: center; flex-direction: column; min height: 100vh; }
GRID
body { display: grid; min height: 100vh; place-content: center; }
The rest is great!
I hope it helps... ๐
Marked as helpful1@graple-guillosPosted about 2 years ago@AdrianoEscarabote Thanks for the feedback! It is really helpful, and i will use these tip in my future projects. ๐๐๐
0 - @correlucasPosted about 2 years ago
๐พHello @graple-guillos, congratulations on your solution!
Nice code and nice solution! You did a good job here putting everything together. Iโve some suggestions for you:
1.To get closer to
overlay effect
on the photo as the Figma Design its better you usemix-blend-mode
. All you need is thediv
under theimage
with thisbackground-color: hsl(277, 64%, 61%);
and applymix-blend-mode: multiply
andopacity: 80%
on theimg
orpicture
selector to activate the overlay blending the image with the color of the div. See the code bellow:img { mix-blend-mode: multiply; opacity: 80%; }
Here's a good article explaining these effects with mix-blend-mode:
https://developer.mozilla.org/en-US/docs/Web/CSS/mix-blend-mode
2.A better way to work this solution image, the product image is by using
<picture>
to wrap it on the html instead of using it as<img>
orbackground-image
(with the css). Using<picture>
you wrap both images (desktop and mobile) and have more control over it, since you can set in the html when the images changes setting the screen size for each image.ote that for SEO / search engine reasons isnโt a better practice import this product image with CSS since this will make it harder to the image.Hereโs the documentation and the guide to use this tag:
https://www.w3schools.com/tags/tag_picture.asp
3.Think about using relative units as
rem
orem
instead ofpx
to improve your performance by resizing fonts between different screens and devices. Anyhow, if we want a more accessible website, then we should use rem instead of px. REM does not just apply to font size, but to all sizes as well.โ๏ธ I hope this helps you and happy coding!
Marked as helpful1@graple-guillosPosted about 2 years ago@correlucas Thanks for the feedback! I really struggle with that image thing and i almost give up until i found a good enough solution. Your tips are very helpful and i will put them into practice in my future projects. ๐
0
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