Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found

Submitted

Responsive stats-preview-card-component using flexbox and MQ

Miassa 100

@Miassa35

Desktop design screenshot for the Stats preview card component coding challenge

This is a solution for...

  • HTML
  • CSS
1newbie
View challenge

Design comparison


SolutionDesign

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

Lucas 👾 104,400

@correlucas

Posted

👾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 device max-width depending of the device (phone / computer) Here’s a guide about how to use picture: 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 the multiply 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 helpful

1

Miassa 100

@Miassa35

Posted

@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
Miassa 100

@Miassa35

Posted

@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
Hyron 5,870

@hyrongennike

Posted

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 to flex-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 helpful

1

Miassa 100

@Miassa35

Posted

@hyrongennike thank you Hyron , i just updated can you tell me please if its right

0
Hyron 5,870

@hyrongennike

Posted

@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
Miassa 100

@Miassa35

Posted

@hyrongennike i will , thank you

0

Please log in to post a comment

Log in with GitHub
Discord logo

Join 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