Responsive stats-preview-card-component using flexbox and MQ
Design comparison
Solution retrospective
I updated the solution using the picture tag but I had a problem in the mobile version, because the color and the background image do not mix and I did not find the error because on desktop it works.
thank you for your help
Community feedback
- @correlucasPosted about 2 years ago
👾Hello Miassa, congratulations for your new solution!
🎯 Your solution its almost done and I’ve some tips to help you to improve it:
1.You did a good work putting everything together in this challenge, something you can do to improve the image that needs to change between mobile and desktop is to use
<picture>
instead of<img>
wrapped in a div. You can manage both images inside the<picture>
tag and use the html to code to set when the images should change setting the devicemax-width
depending of the device (phone / computer) Here’s a guide about how to usepicture
:https://www.w3schools.com/tags/tag_picture.asp
2.Make your hero image have the same look and the color purple overlay, you need to use
mix-blend-mode
using themultiply
one.The mix-blend-mode CSS property sets how an element's content should blend with the content of the element's parent and the element's background.Here’s how you can add this to your
img
selector:img { mix-blend-mode: multiply; opacity: 84%;}
Here's a good article explaining these effects with mix-blend-mode:
https://developer.mozilla.org/en-US/docs/Web/CSS/mix-blend-mode
✌️ I hope this helps you and happy coding!
Marked as helpful1@Miassa35Posted about 2 years ago@correlucas thank you Lucas for your advice, i just updated the solution using the picture tag but I had a problem in the mobile version, because the color and the background image do not mix and I did not find where is the error because on desktop it works.
0@Miassa35Posted about 2 years ago@correlucas I updated the solution using the picture tag but I had a problem in the mobile version, because the color and the background image do not mix and I didnt find the error because on desktop it works
0 - @hyrongennikePosted about 2 years ago
Hi @Miassa35,
Congrats completing the challenge. Just look at desktop again all the elements are stacking so you'll most likely just need to either add
display: flex
or set toflex-direction: row
you can also add the following on the body to center the card:body { display: flex; justify-content: center; align-items: center; }
and you can add
order: -1;
to the content card to move it to the left side on desktop.Marked as helpful1@Miassa35Posted about 2 years ago@hyrongennike thank you Hyron , i just updated can you tell me please if its right
0@hyrongennikePosted about 2 years ago@Miassa35 Looks good! and yes it's centered you can use that rule on any parent element where you want the child element to be centered.
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