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 trialMatt Cornett
115 PointsWhen Creating code for a website, how do you tell the computer that your page is an html document
how do i tell the computer that my document is an html document
3 Answers
Marcel van der Hoek
17,010 PointsHave you tried saving your file with an .html extension?
Jason Baxter
2,602 PointsAdding <!DOCTYPE html> at the beginning of the document as well as saving with a .html extension should do it. Can you describe the issue you are running into in more detail?
Wayne Priestley
19,579 PointsHi Matt,
As Marcel has said, all the computer reads is the file extension to know what type of document it is, so .html will do it.
An example of this would be:
black.html black.png black.pdf black.doc
All of the above have the same name but with a different file extension, the computer does not look inside to know the type of file it is, it relies on the extension you have given it. Change the extension on one of your files and watch your computer try to open it in a different application because it thinks its now a different type of file.