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!
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

David Choi
8,536 PointsQuestion about CSS
I was learning about CSS and I wanted to ask some questions
4 Answers

Jason Anello
Courses Plus Student 94,610 PointsOnly certain properties will be inherited by descendant elements. For instance, paragraphs would inherit the color of their parent assuming they haven't already been assigned a color. Anchor links are an exception and usually would not inherit their parent color because the browser gives them a color in its style sheet.
By contrast, margins and padding would not be inherited.
Here's a table showing what can be inherited:
http://www.w3.org/TR/CSS2/propidx.html
So probably about half or less of the properties can be inherited.

Eric Flowers
9,472 PointsYes, unless you specify style for a particular element, class or ID within the wrapper to override.

Brad Bucceri
7,102 PointsYes, your CSS cascades (flows down) through your HTML. Whatever styles you apply at the highest level will be applied to the deepest nested level.
You are then able to target specific classes or id's within the parent element you talk about to apply different styles.

James Barnett
39,199 PointsThe above answers are short but essentially correct. If you are looking for more details about inheritance in CSS check out:
David Choi
8,536 PointsDavid Choi
8,536 PointsI wanted to ask a simple question about CSS. So, if you style a <div> element which wraps around a whole chunk of code does the style declarations you made for the <div> element apply to every single element inside?