Design comparison
Solution retrospective
What do you recommend to improve this code?
Community feedback
- @VCaramesPosted about 2 years ago
Hey @serFar, great job on this project!
Some suggestions to improve you code:
-
For accessibility purposes, its better to use rem/em instead of px for your CSS property values.
-
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 helpful2 -
- @faha1999Posted about 2 years ago
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 ofdiv
. 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 likerem or em
to get better performance when the information on your page needs to be resized for multiple screens and devices.REM
andEM
apply to all sizes, not justfont-size
. You can code your entire page inpx
and then, at the very end, use the VsCode pluginpx to rem
to perform the automatic conversion px to rem
I hope it will work. Happy coding.
Marked as helpful1 - You might want to use semantic tags like the
- @101AminePosted about 2 years ago
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 yourbody
body { height: 100vh; display: flex; align-content: center; justify-content: center; }
2 - Use units as
rem
orem
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 helpful1 - @correlucasPosted about 2 years ago
👾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
oumix-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 GitHubJoin 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