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 trialMichael Bianco
1,194 PointsI understand that u need to declare the document type w <!DOCTYPE html> but why do you include html twice under it?
If <!DOCTYPE htlm> signifies that you are going to be making html stuff, why directly under do you write html twice?
<!DOCTYPE html>
<html> </html>
2 Answers
Rick Gleitz
47,840 PointsBetween those two tags is where all your HTML formatted code is going to go. Think of it as the code's way of telling the browser that what follows is to be interpreted/rendered using the HTML language, as opposed to other formats for displaying in the browser.
Douglas Counts
10,126 PointsThere were many versions of the HTML language prior to HTML5 and they were rendered different ways by the browser. The standard is now HTML5 and that first line informs the web browsers that what follows is to be rendered as HTML5. HTML5 added many new tag types that previously didn't exist and without the DOCTYPE line, there is a chance your page will not render properly if you use these newer features.