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 trial8 Answers
Steven Collins
Courses Plus Student 18,004 PointsHey Lida,
The doctype is required before anything else on the page. It is a short message to the web browser to expect a document type.
For example:
<!DOCTYPE html> tells the browser get ready for some html 5.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> Tells the browser to get ready for some HTML 4.01 Transitional
Check out this link for more info http://www.w3schools.com/tags/tag_doctype.asp
Maximiliane Quel
Courses Plus Student 55,489 Pointsat the very top of your html file before any element is set, you define the document type to let the bowser know what version of html you want to use, e.g. html5
this looks like this
<!DOCTYPE html>
Maximiliane Quel
Courses Plus Student 55,489 Pointsprogramming languages are often very sensitive to cases or white space. if you remove the space between it should work just fine.
Maximiliane Quel
Courses Plus Student 55,489 Pointsi.e.
you should have:
<!DOCTYPE html>
instead of
<! DOCTYPE html>
Lida Wahdat
400 PointsThis is exactly what I write, but still says the same thing. And thank you for responding. :)
Maximiliane Quel
Courses Plus Student 55,489 Pointsyou mean you pressed the check work and next task button but don't get the next question?
Lida Wahdat
400 Pointsyes, it says bummer, make sure to define doctype tag
Maximiliane Quel
Courses Plus Student 55,489 Pointscan you copy paste exactly what you try to input?
Lida Wahdat
400 Points<! DOCTYPE html>
Maximiliane Quel
Courses Plus Student 55,489 Pointsthe reason it doesn't work is because you have a space between the exclamation mark and the word DOCTYPE.
Lida Wahdat
400 PointsAm I doing something wrong?
Lida Wahdat
400 PointsHello! Sorry for my late response! Thanks so much for the help! I was able to complete it. Still very new to this. :)