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 Card with CSS

Mgamboa 200

@Marianellag1

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


Hello! From previous comments, Its truly-true that if you use bootstrap and framework, "helpful sites" for challenges, its not a good thing because you don't learn the raw css that is much more useful. And cannot agree more. Still learning tho, so any help to improve in any part of the code will be appreciated. Thank you!

Community feedback

Hassia Issah 50,830

@Hassiai

Posted

To center .card on the page, add min-height:100vh; display: flex; align-items: center: justify-content: center; or min-height:100vh; display: grid place-items: center to the body.

To center .card on the page using flexbox:
body{
min-height: 100vh;
display: flex;
align-items: center;
justify-content: center;
}
To center .card on the page using grid:
body{
min-height: 100vh;
display: grid;
place-items: center;
}

For the color of the image, give .image a background-color of soft violet and give the img a width of 100%, height of 100%, object-fit: cover, mix-blend-mode: multiply and opacity: 0.8.

.image{
background-color: hsl();
}
img{
width: 100%;
height: 100%;
object-fit: cover;
mix-blend-mode: multiply;
opacity: 0.8;
}

Use relative units like rem or em as unit for the padding, margin, width values and preferably rem for the font-size values, instead of using px which is an absolute unit. For more on CSS units Click here

Hope am helpful.

Well done for completing this challenge. HAPPY CODING

Marked as helpful

0

Mgamboa 200

@Marianellag1

Posted

@Hassiai Hello! I wasn't aware of those, only really used px in bootcamp. But thank you, I will watch the vid and try to play around with those to learn how they work. Thank you for the help!

1
Ansly 230

@Median21

Posted

Hello Mgamboa 👋

I have few concerns regarding the design:

  • I suggest adding more padding in your column or first class, so that it has a bigger spaces on the sides.

  • Next, is the color of the image, I suggest researching about the mix-blend-mode property, to be able to match the color of the image in the design. Specifically for me, I used the mix-blend-mode: multiply

You can check it out here: w3schools mix-blend-mode

Overall, you did a very good job. Keep it up! 💪

Marked as helpful

0

Mgamboa 200

@Marianellag1

Posted

@Median21 Hello! I will try that because I had such a hard time trying to change the color and maybe I just didn't know how to search it up to get a solution. Thank you very much I will try it out!

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