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 trialJason Bacaj
894 PointsFeeling like a total idiot
I'm starting the HTML deep dive and am getting along writing the language and everything, but it simply isn't... working. When Nick, in the video, writes code things are indented and highlight and turn different colors automatically. He refreshes the webpage and it does the things he wants it to do. For me, the HTML simply shows up on the page the way it's written in the TextEdit document rather than manipulating the web page the way it should. Am I doing something horribly wrong? I'm so confused...
8 Answers
Chase Lee
29,275 PointsIs your file named "index.html"?
kg10
7,911 PointsHi Jason! Did you use html tag? If you could paste your code here that would be easier to help :-)
Jason Bacaj
894 PointsHere's the code I used:
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>My Page</title>
</head>
<body>
<div>This is a <div>div</div>.</div>
<span>This is a span.</span>
</body>
</html>
kg10
7,911 PointsIf you are using text edit I think the problem is your file has a name of "index.html.txt" or something similar instead of "index.html". Your first code looks fine and meta tag can't be that important. Ages ago I wrote my code only in notepads with no meta tags and it was working fine.
Sharon Walls
9,234 PointsI second this.
When you go to save your file, select "All File Types" instead of ".txt" under "Save File As". Even if you feel like you've done it, sometimes it's not done at all. :)
Alternatively, when you view your file in the folder, the "Type" should say "HTML File" not "Text File".
Jason Bacaj
894 PointsI did save it as "index.html". Here's the code:
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>My Page</title>
</head>
</html>
Jason Bacaj
894 PointsHuh. That's different!
Chase Lee
29,275 PointsJason Bacaj I reformatted your code for you. You can find out how I did it here.
Jason Bacaj
894 PointsI'm opening it in firefox, does that make a difference?
Chase Lee
29,275 PointsTry using this meta tag:
<meta http-equiv="Content-Type" content="text/html, charset=utf-8">
Alex Hedley
16,381 PointsYou mentioned TextEdit, is that the app you're using? If so you should really use something like Sublime Text, Textastic, TextMate etc
Chase Lee
29,275 PointsYes that is very true. Although TextEdit does work.