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
Amr Tag
5,429 PointsWhat does the display property affect?
Hello, I have a question regarding display property about what element does it affect? The parent or the child elements?
Say I set
div {display: inline-block};
And I had some paragraphs inside that div, well they occupy one line? Or will that div allow other elements to occupy the line next to it but the paragraph elements will occupy a full line inside that div?
(If the question sounds a bit stupid, it's because I'm really a beginner at all this, but highly interested)
1 Answer
Adam Sackfield
Courses Plus Student 19,663 PointsThe display property affects the property it is applied to, so in your example the "div" will be inline-block but all child elements will behave as default and not inherit the "div" display property.