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

HTML Introduction to HTML and CSS (2016) Adding a New Web Page Test: Write and Style an Element

I don't understand what's the error

I followed the style, and it said that i'm wrong.

index.html
<!doctype html>
</html>

1 Answer

Ryan Dudley
Ryan Dudley
Treehouse Project Reviewer

Hey Francis, hope you are having a good weekend thus far!

This should be a simple fix, as you are essentially just missing an opening <html> tag. I suspect you might be confusing the <!DOCTYPE html> as the opening tag for the <html> tag. To be a bit more clear on what is happening here, the doctype declaration is essentially not an HTML tag; it is an instruction to the web browser about what version of HTML the page is written in. Whereas the html tag represents the root of an HTML document and is the container for all other html elements (except for the aforementioned doctype.)

So to make this test pass, you need to add an opening <html> tag after your doctype declaration. So all in all you should have something like this:

<!DOCTYPE html> <!-- This tells the browser this is an HTML5 document -->
<html> <!-- This is the opening tag for our root html element, all other elements are contained within this! -->
</html> <!-- This is the closing tag for our root html element. -->

I hope you found this helpful, and good luck!