Design comparison
Solution retrospective
https://briancarlo24.github.io/Stat-Preview-Card-Component/
For this challenge I added 1000px width to the card container. Reason for doing that is to avoid the image being stretch making it look weird.
The mobile design with be triggered at around 375px and that would be another design to make it responsive. However, on breakpoint 1000px(estimation) the right container will move below which is suppose to trigger at 375px only.
How do you fix that? Is adding a fix width the best solution here?
Community feedback
- @makoydevPosted over 3 years ago
Hi Brian, you can do object-fit: fill; on the image part. it will automatically resize the image for you and avoid any stretch. Hope this helps.
1@Briancarlo24Posted over 3 years ago@makoydev Thanks for the reply. That's new to me.
Also, I was wondering if there is a way to blend image to the color-overlay. I used opacity around 60% for the overlay.
I appreciate your reply.
1@makoydevPosted over 3 years ago@Briancarlo24 Hi again Brian, if you're using img then you can use object-fit:fill. But if you're using the image as background image you can do it this way.
width: 100%; height: 100%; background-image: url(../images/image-header-desktop.jpg); background-size: cover; background-repeat: no-repeat; background-position: 50% 50%; background-color: $--clr-violet; background-blend-mode: multiply;
make sure the parent container of your image is set as 50% width. This will help you to resize the image to 100% of 50% of its parent container. On the overlay part, I have used background-blend-mode. Just set the background color to $--clr-violet: hsl(277, 64%, 61%); (Btw, I'm using Sass that's why it's like that) on top of the background image you've set then add the background-blend-mode property in order to blend both of them. There are plethora of choices in blending but background-blend-mode: multiply; fits best for the project.
If you have any question just email me to [email protected] i'll try to help.
0@Briancarlo24Posted over 3 years ago@makoydev Thanks, I just did that actually and it looks better now.
I appreciate all the help.
1
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