Design comparison
Solution retrospective
Did mobile without any issues, but really struggled to go from mobile over to Desktop, took me many many hours the image just wouldn't fit, and it messes up badly in the 1000px-1400px range, where have I messed up? I guess it fits the design for the actual 1440px and 375px spec but I plan to make all my designs full responsive on most devices. Am I doing something fundamentally wrong with how I'm doing my mobile so making it too hard moving over to Desktop? I didn't know where the hell I was with all the margins and paddings used haha.
Oh and that color on the image, the best I could get was with mix blend mode multiple with opacity's on the background and the ::before. Is there an easier way to match the design?
Any tips or advice would be mostly appreciated I'm mostly worried about bad practise and planning for mobile to desktop. Thank you.
Community feedback
- @imfabraPosted over 3 years ago
Wow, it looks really cool. to get the most similar color use "mix-blend-mode" with an opacity of 75%, consult the documentation, it will help you a lot: https://developer.mozilla.org/es/docs/Web/CSS/mix-blend-mode
I also invite you to see the solution I made of this exercise and leave your comment: https://www.frontendmentor.io/solutions/stats-preview-card-component-solution-html5-css3-bem-QCrz6ndBt
Let's keep coding.
0 - @AgataLiberskaPosted over 3 years ago
Hi @nfjwebuk! well done on this challenge! I definitely agree that you should try to make your designs look great on most screens if all is impossible :)
When you're struggling with something CSS-related, it's always a good idea to open devtools and see what styles are actually being applied, and try to figure out why. What I see happen now is: as I open your solution on my desktop, the layout looks great, but at 1024px for example, the image div doesn't fill up the whole container height. Is that the issue you were having? This is because you have set a height on that div and it can't grow any taller than that. To fix it in your solution, I would suggest using
height: auto
(or initial, same thing in this case). Auto height normally means that the height is set to fit the content and you've got an empty div which would give you 0px, but as you've got flexbox there, it will stretch the children to fit the space available. Does this make sense? :DWhat I would also do is set a max-width on your whole card in your mobile layout - I just think it would look better and you don't lose so much of the image.
And to get the overlay - you can set
background-color
on the same div as your image, and usebackground-blend-mode
to blend it together.Hope this helps! If you have any questions let me know :)
0@nfjwebukPosted over 3 years ago@AgataLiberska
Thank you very much for your reply, yes that's the issue I was having :) it drove me nuts. I tried to google but to no avail.
Thank you for the tips, I will definitely try and work the height auto and max-width onto the card it's self. I will play about with the background-blend-mode also.
Very much appreciates, cheers!
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