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

HTML + CSS Grid responsive page

@BernardoHollmann

Desktop design screenshot for the 3-column preview card component coding challenge

This is a solution for...

  • HTML
  • CSS
1newbie
View challenge

Design comparison


SolutionDesign

Solution retrospective


I would like to know if there is a way to inherit the background-color of a parent element in other attribute of another child class. Is there a way that this can be done only with CSS?

Community feedback

Lucas 👾 104,420

@correlucas

Posted

👾Oi Bernardo , tudo bem? Parabéns pela sua nova solução!

Respondendo sua pergunta:

Herdar a cor de um elemento pai eu nao sei te responder, mas o jeito mais fácil de trabalhar com cores que se repetem é só usar variaveis no root e reutilizar essa variavel toda vez que uma cor seja usada mais de uma vez.

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

Marked as helpful

1

@BernardoHollmann

Posted

@correlucas Oi Lucas! Pois é, eu me deparei com uma situação neste último desafio e fiquei tentando achar uma melhor solução. Na parte do CSS eu tinha:

.card-1 button{ color: hsl(31, 77%, 52%); border: 3px solid hsl(31, 77%, 52%); }

e queria saber se teria alguma forma de herdar a cor do background da própria div section card-1, por exemplo. Desta forma, pouparia algumas linhas de código aplicando no elemento filho (button) a cor do texto e da borda.

0
Lucas 👾 104,420

@correlucas

Posted

@BernardoHollmann o melhor jeito seria criar uma class tipo btn pra essas duas propriedades e aplicar em todos botoes

0
Lucas 👾 104,420

@correlucas

Posted

@BernardoHollmann o melhor jeito seria criar uma class tipo btn pra essas duas propriedades e aplicar em todos botoes

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