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

Stats Preview Card w/ SCSS

#accessibility#sass/scss#bem

@dhatGuy

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


The image doesn't look good enough on larger screen

Community feedback

Lucas 👾 104,540

@correlucas

Posted

👾Hello Joseph Odunsi, congratulations for your new solution!

🎉 Nice solution and nice code! I can see that you paid a lot of attention to your code/design. If you don’t mind I’ve some tips for you:

1.The best to way to have this image and every image responsive and easy to work, its by creating a general property adding display: block and max-width: 100% to make it fits the size of the container the image is inside and also respect the container width while scaling, add alsoobject-fit: cover to make the image auto-crop when resizing inside the column:

img {
    display: block;
    object-fit: cover;
    max-width: 100%;
}

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 sites 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

0

@dhatGuy

Posted

@correlucas, thanks for the feedback.

0
Hyron 5,870

@hyrongennike

Posted

Hi @dhatGuy,

Congrats on completing the challenge it is a good first attempt

Just a few suggestion for desktop as mobile seems fine. You can set the padding on the following rule to 0 and make the changes and add the following to the media query for desktop:

body .card {
    max-width: 1170px;
    flex-direction: row-reverse;
    padding: 0;
}

.card > div {
    flex: 1;
}

img, picture {
    width: 100%;
}

The above is a good starting point. Hope it helps.

Marked as helpful

0

@dhatGuy

Posted

@hyrongennike thanks. Looks good now.

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