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 Card built with Sass

graple-guillosโ€ข 40

@graple-guillos

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 had trouble trying to write media queries and keeping things aligned when i stretched the website for the desktop design. Things kept breaking and i tried to fix everything in the best way i could, but it's far from good. Any help ?

( Sorry if i misspell or wrote something in a weird way. I'm a beginner English student and i'm still figuring things out. Thanks for the patience. )

Community feedback

Adrianoโ€ข 34,090

@AdrianoEscarabote

Posted

Hi graple-guillos, how are you?

I really liked the result of your project, but I have some tips that I think you will enjoy:

A good practice to center content is using grid or flex-box, avoid using margin or padding to make placements, use only in the latter case! we can do it like this:

Flex-box:

body {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    min height: 100vh;
}

GRID

body {
    display: grid;
    min height: 100vh;
    place-content: center;
}

The rest is great!

I hope it helps... ๐Ÿ‘

Marked as helpful

1

graple-guillosโ€ข 40

@graple-guillos

Posted

@AdrianoEscarabote Thanks for the feedback! It is really helpful, and i will use these tip in my future projects. ๐Ÿ‘๐Ÿ˜Ž๐Ÿ‘

0
Lucas ๐Ÿ‘พโ€ข 104,420

@correlucas

Posted

๐Ÿ‘พHello @graple-guillos, congratulations on your solution!

Nice code and nice solution! You did a good job here putting everything together. Iโ€™ve some suggestions for you:

1.To get closer to overlay effect on the photo as the Figma Design its better you use mix-blend-mode. All you need is the div under the image with this background-color: hsl(277, 64%, 61%); and apply mix-blend-mode: multiply and opacity: 80% on the img or picture selector to activate the overlay blending the image with the color of the div. See the code bellow:

img {
mix-blend-mode: multiply;
opacity: 80%;
}

Here's a good article explaining these effects with mix-blend-mode: https://developer.mozilla.org/en-US/docs/Web/CSS/mix-blend-mode

2.A better way to work this solution image, the product image is by using <picture> to wrap it on the html instead of using it as <img> or background-image (with the css). Using <picture> you wrap both images (desktop and mobile) and have more control over it, since you can set in the html when the images changes setting the screen size for each image.ote that for SEO / search engine reasons isnโ€™t a better practice import this product image with CSS since this will make it harder to the image.

Hereโ€™s the documentation and the guide to use this tag: https://www.w3schools.com/tags/tag_picture.asp

3.Think about using relative units as rem or em instead of px to improve your performance by resizing fonts between different screens and devices. Anyhow, if we want a more accessible website, then we should use rem instead of px. REM does not just apply to font size, but to all sizes as well.

https://www.frontendmentor.io/solutions/stats-preview-card-vanilla-css-custom-design-text-animation-RfGBFlMpwK

โœŒ๏ธ I hope this helps you and happy coding!

Marked as helpful

1

graple-guillosโ€ข 40

@graple-guillos

Posted

@correlucas Thanks for the feedback! I really struggle with that image thing and i almost give up until i found a good enough solution. Your tips are very helpful and i will put them into practice in my future projects. ๐Ÿ‘

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