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

Seção de recursos de quatro cartões

@ThiagoTelheiro

Desktop design screenshot for the Four card feature section coding challenge

This is a solution for...

  • HTML
  • CSS
1newbie
View challenge

Design comparison


SolutionDesign

Solution retrospective


What specific areas of your project would you like help with?

Dicas são bem vindas!

Community feedback

@Allyhere

Posted

Parabéns pelo trampo! Achei legal como tu resolveu com a div no centro! Tenho algumas dicas de CSS, espero que ajude de alguma forma.

1 - Não precisamos mais usar @charset

Segundo a MDN: "The CSS syntax module deprecates this rule, defining it as an unrecognized legacy rule to be dropped when a stylesheet is grammar-checked, but it is fully supported in all browsers."

2 - Ao invés de aplicar classes pra cada texto e fonte, identifique quais combinações de texto e fonte existem e crie classes utilitárias pra elas

Se tu pensar bem, tem apenas 3 combinações de fonte nesse projeto - o heading, os títulos dos cards e os textos descritivos:

.heading {
  font-size: var(--font-size);
  font-weight: 100;
}

.heading strong {
    letter-spacing: var(--letter-spacing);
 }

.title {
  font-size: 1.25rem;
}

.text {
  font-size: 15px;
  color: var(--accent);
}

3 - Sempre que puder economizar classes, economize! Muita especificidade pode ser ruim.

Exemplo:


/* Nesse caso isso */
.cards .card-supervisor, .card-team, .card-karma, .card-cal {
    display: flex;
    flex-direction: column;
    background-color: var(--Very-Light-Gray);
    width: 350px;
    height: 250px;
    border-radius: 8px;
    box-sizing: border-box;
    padding: 30px;
    box-shadow: 1px 1px 25px var(--Grayish-Blue);
}

/* poderia ser isso */

.cards > * {
   /* ... */
}

/* ou até isso */

[class^=card-] {
   /* ... */
}

4 - Sempre importe as fontes no HTML Se você importar a fonte no CSS, o navegador vai:

  1. Baixar o HTML
  2. Ler o HTML até encontrar o CSS
  3. Baixar o CSS
  4. Ler o CSS até encontrar a fonte
  5. Baixar a fonte

Se você importar a fonte no HTML, o navegador vai:

  1. Baixar o HTML
  2. Ler o HTML até encontrar a fonte
  3. Baixar a fonte

Bons estudos!

Marked as helpful

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