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 component in HTML5, SCSS, BEM, Gulp, Flexbox, Grid

#bem#sass/scss#gulp
Yari Morcusβ€’ 480

@YariMorcus

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 have no questions about this challenge, but you are always free to give me some tips.

Community feedback

Lucas πŸ‘Ύβ€’ 104,580

@correlucas

Posted

πŸ‘ΎHello Yari, congratulations for your solution!

Your solution its really accurate, all the elements and colors are matching the design files.

I've some tips for you and you see if is good idea to apply or not to your code Yari.

If you want to improve a bit your code you can use less elements to wrap the two columns, there's no need for so many divs. Look that you container is fully responsive so you don't need to set so many media queries since the container is fluid it will contract and fit the information inside, so you can use only the mobile media query.

Instead of managing both mobile and desktop image versions with media query and background-image a quick fix is to use the <picture> tag and wrap both images inside the html setting when the images should switch, with no need for media query for image changes.

To reach the exact same color for the image overlay, you can use mix-blend-mode: multiply; and opacity: 0.8;.

Hope it helps Yari, and happy coding!

Marked as helpful

1

Yari Morcusβ€’ 480

@YariMorcus

Posted

Hi @correlucas,

Thank you for your feedback! I really appreciate it that you took your time for me.

I implemented your feedback by doing the following:

  1. I replaced <header> with <picture>
  2. Added the right overlay color on the image

At first, I did try to use <picture> instead of a CSS background image, but I couldn't get it working with the overlay. I didn't know about mix-blend-mode before (could not find anything of it on the internet at first) but now knowing that this feature exists, I could get it working. So thank you for that!

The reason why I used so many media queries is because I didn't like the design on tablet, and since there wasn't a design given for tablet, I decided to add my own touch to it haha. But as a result, I did had to use more media queries.

At the moment of writing, GitHub Pages didn't apply the CSS correctly just yet, so be aware of this when previewing the site

1

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