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
Iñigo de Jesús Valdivia Narváez
Courses Plus Student 1,340 PointsWriting the top border selecting the <html> tag intead of <body> tag.
Hi. Why Joy decided to write the top border selecting the <html> tag intead of the <body>?
Previously she said everything we see (the visual part) in a webpage goes in to the <body> tag, so why she choose <html>? And when should I use the <html> tag to style the website and when use the <body>?
Thanks for any tips.
3 Answers
Aurelian Spodarec
10,801 PointsYou should put stuff inside your body for the display.
And what part did she said that and video?
Iñigo de Jesús Valdivia Narváez
Courses Plus Student 1,340 PointsHi, thanks for the answer. I thought my question will be in the video section I saw the code I described. I don't know why isn´t there.
Here is an image of the code I talk about:
Aurelian Spodarec
10,801 PointsYou an asign colors to anything. Asigning colors to html isn't the best from my point of view. If i usually do something to html tag, is to set width and height to 100%, depending on the project.
I guess she was showing you that you can, and whatever she was talking after the video, I don't know the context but maybe she said more at the end.
Usually you define your global style sin body, like background color.
At least thats as far as i know.
Iñigo de Jesús Valdivia Narváez
Courses Plus Student 1,340 PointsThe context of the video is about css colors and fonts, not about selectos, that's why she didn´t mentioned anything about that. But it make me think why she choose <html> and not <body>.
I'll wait until I watch the CSS courses here at TH, since these series are only an introduction to Web Development.
Thanks for your comments, James Bond 007.
Aurelian Spodarec
10,801 PointsWell, I suppose just because she can, or show you that you can select HTML too : p I don't see why this should be mysterious.
HTML wraps the entire web browser like body, kinda, but in terms of colors yes, so i don't think there's much of a difference.