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
leekrumtinger
1,046 PointsSays my title isnt between <body></body> what am i doing wrong ?
<!DOCTYPE html>
<html>'hey'</html>
<html><head>'to the floor we go'</head><body>'to the river we went'</body></html>
<html><body><p>'My first paragraph!'</p></body></html>
2 Answers
Sergey Podgornyy
20,660 PointsYour code structure should be like:
<!DOCTYPE html>
<html>
<head>
<title>This is title of a page</title>
</head>
<body>
<p>My first paragraph!</p>
</body>
</html>
html, head and body tags should be unique on your page. title should be inside head tag.
More about DOM structure you can read here - http://www.w3schools.com/js/js_htmldom.asp or here - http://www.w3schools.com/js/js_htmldom_navigation.asp.
Also you need to know:
-
htmlis the root node -
htmlhas no parents -
htmlis the parent ofheadandbody -
headis the first child ofhtml -
bodyis the last child ofhtml
Usualy DOM structure looks like:
Jonah Chason
5,935 PointsThe title element should go inside the head element. The head comes before the body element, right after the html element.
Austin Whipple
29,847 PointsChanged your comment to an answer and formatted the code a bit.
