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

CSS How to Make a Website Beginning HTML and CSS Write a CSS Selector and Property

Can someone please explain They never explained body so i am confused

Task is wanting a body and i am confused don't remember them going over it

index.html
<body>
    <h1>Nick Pettit</h1>
</body>

2 Answers

Nicholas Olsen
seal-mask
.a{fill-rule:evenodd;}techdegree
Nicholas Olsen
Front End Web Development Techdegree Student 19,342 Points

The basic structure for every HTML document is like this:

<!DOCTYPE html>
<html>
    <head>
        <title>The title of your document</title>
    </head>
    <body>
        <h1>Nick Pettit</h1>
    </body>
</html>

The first line is <!DOCTYPE html>, this tells the browser to interpret your document as html.

The next line is html tag. This tag corresponds to the /html at the end of the document. Anything within these tags composes your HTML document.

Then there are two basic sections, the head section and the body section. The head section holds "meta" information like the title of the document, and some other things that you will learn about later.

The body section holds the visible parts of your webpage. The h1 tag is an example of a visible element: a "heading" element.

The "body" of the document (all tags and content between the opening and closing body tags) is the part of the document that is--at least potentially--seen by the user in the browser. The "head", on the other hand, contains things like links to CSS files and fonts, meta information, etc.

There are certainly exceptions to this (javascript files are often included right before the closing body tag, and we can use CSS to hide ANY element), but it's clear that if we want to display content to the user (an image, a heading, a paragraph, a list), we will include it in the body of the HTML document.