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

@serFar

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


What do you recommend to improve this code?

Community feedback

@VCarames

Posted

Hey @serFar, great job on this project!

Some suggestions to improve you code:

  1. For accessibility purposes, its better to use rem/em instead of px for your CSS property values.

  2. To help keep your CSS code organized and easier to use, I suggest implementing CSS Variables. This will come in handy when building large websites, using light/dark mode, etc…

It’ll look something like this:

:root {
  --primary-color: value;
  --secondary-color: value;
  --tertiary-color: value;
}

And to use the variables you’ll use the var() function. So it’ll look like this.

h1 {
color: var(—primary-color);
}

Heres are some articles regarding CSS Variables.

You can also take a look at my projects and see how I use it.

https://developer.mozilla.org/en-US/docs/Web/CSS/Using_CSS_custom_properties

https://www.w3schools.com/css/css3_variables.asp

Happy Coding!

Marked as helpful

2

@faha1999

Posted

Hello, Sérgio Faria Congratulations on finishing this project. It's lovely and great on the whole! Just a little tip:

  • You might want to use semantic tags like the <main> to wrap your code, instead of div. like
<main class="container">
</main>

This would help improve accessibility.

  • add favicon <link rel="icon" type="image/png" sizes="32x32" href="./images/favicon-32x32.png">

  • Instead of using px, use relative units like rem or em to get better performance when the information on your page needs to be resized for multiple screens and devices. REM and EM apply to all sizes, not just font-size. You can code your entire page in px and then, at the very end, use the VsCode plugin px to rem to perform the automatic conversion px to rem

I hope it will work. Happy coding.

Marked as helpful

1
101Amine 260

@101Amine

Posted

Hello @serFar , congratulation on completing this challenge!

1 - There's a way to center your container without using the position absolute and stuff, you can add .container { align-self: center; } and then add this to your body

body {
       height: 100vh;
       display: flex;
       align-content: center;
       justify-content: center;
}

2 - Use units as rem or em instead of px to improve your performance by resizing fonts between different screens and devices. These units are better to make your website more accessible. REM does not just apply to font size, but all sizes as well.

3 - If you want to add the same effect of the design for the image overlaying it with purple there's a shortcut that is by using mix-blend-mode with the mode multiply and with an opacity around opacity: 82%. but i don't think you can use it with the background-img:

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

And just a last tip that was given to me too, add the correct size for the container max-width: 1110px to dont have it growing more than it should.

I hope this helps you and happy coding!

Marked as helpful

1
Lucas 👾 104,400

@correlucas

Posted

👾Oi @serFar, tudo bem? Parabéns pelo desafio!

Acabei de ver sua solução e tenho umas dicas pra melhorar seu código/design:

O tamanho do container está um pouco fora do design, o tamanho exato pra esse container é max-width: 1110px que é um tamanho padrão de container usado aqui.

Para adicionar exatamente o mesmo efeito de sobreposição roxo para a imagem, combinando os arquivos de design que você pode usar, filter, background-blend-mode ou mix-blend-mode: multiply; (a melhor escolha na minha opinião). Veja o código abaixo ```

img {
mix-blend-mode: multiply;
opacity: 0.8;}

👋 Espero que essas dicas te ajudem e que você continue no foco!

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