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 trialWANG YONGXIN
1,618 Pointswhy I should add backgroud-color style to html element when the body element is centered?
the teacher said:"but if you want give your page a full color...you need to add it to your html element."
why i should add it to html?I add it to body,there is seemly no difference from adding it to html element.
1 Answer
Camilla Holst
8,876 PointsIf you give your body a width of, for instance, 80 %, then you would be able to use is a the main wrapper and give that another background color than the whole page :) But you are right, there are many ways of achieving the same thing in CSS
WANG YONGXIN
1,618 PointsWANG YONGXIN
1,618 PointsThank you a lot for your help.I get it.