Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial
Melissa Eaton
8,296 PointsWhy have "inherit" keyword as property value when an element is supposed to inherit values automatically?
I noticed during the CSS Basics videos that often the "inherit" keyword would pop up as an option for values. But, during the Inheritance video, Guil says that elements already inherit values from their parent elements. So, then, what would be the purpose of using the "inherit" keyword value? What's a situation when I would need to use this?
Example:
p {
color: inherit;
}
1 Answer
Michael Brown
7,431 PointsGuil also mentioned some elements don't inherit, such as the color of the <A> link element. You can override the normal “blue” browser color on the <A> element by giving it a color value of “inherit”. See additional explanation at this site.