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

Responsive 3-column preview card using CSS flexbox

@garang-deng

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 love how I'm improving lately👌😍 but how some things just don't work out is so frustrating and irritating 😒😢

Why doesn't my "color: inherit;" works? I'll really appreciate any help from you guys, much thanks.

Community feedback

@DimiPavlov

Posted

Hello Garang, congratulation on completing the challenge.

Regards your question about color: inherit not working, I suggest you take a look at the MDN site about the 'inherit' property.

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

It does inherit the color of the parent element, in your case, that's the sections. If you take a look at your code, you will see that your section has no color property, only a background-color. So you are trying to inherit a color from a background-color, which is not possible. You can add a random color to your sections and see how your button color will also inherit it.

Hope I was able to help you.

Happy coding :)

Marked as helpful

0
P

@mihalymarcell86

Posted

Hello @Garang-Deng,

the problem with color: inherit is that you didn't specify the color property in any of the parent elements of the button, so at the moment it gets its color from the user agent default stylesheet. It won't work between different properties, though. You can't "inherit" the value of a background-color property of the parent to become the value of a color property in the child element. You can, however, set the color property to the same custom property value you used for your background. In that case both background- and font colors will stay in sync, if you wanted to change them.

Hope, this helps! :)

Marked as helpful

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