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

Tags are seen in browser while editing on TextEdit (Mac)

I seem to not catch how to make that all the edits would not be seen in a browser. I saved the file as index.html, but when I add tags - in browser I can see them =/ Can anyone explain, please?

2 Answers

Mike Bronner
Mike Bronner
16,395 Points

Can you post your complete index.html code to http://pastebin.com and share the url? That way we can take a look and see what's happening.

[Update] Don't forget to encapsulate your code within the basic HTML structure for the page:

<!DOCTYPE html>
<html>
<head>
... head code goes here, if you have any, like title tag ...
</head>
<body>
... your code goes here ...
</body>
</html>
Mike Bronner
Mike Bronner
16,395 Points

Updated my original answer with complete answer based on your code in paste bin.

Merry Christmas! :) ~Mike

Thank you! Merry Christmas! :)

James Barnett
James Barnett
39,199 Points

Rather than posting static code on a site like paste bin or github, it's easier to troubleshoot with a working demo using something like codepen.io

Mike Bronner
Mike Bronner
16,395 Points

Good point, James. I will make an effort to do so going forward. I have used jsFiddle in the past, but it takes some getting used to. I'll check out code pen and others as well. :)

James Barnett
James Barnett
39,199 Points

I prefer the UX of codepen over JSFiddle. There's also CSS Flow & Dabblet among others. For JS stuff I like JSBin because it has a console window built in.

Mike Bronner
Mike Bronner
16,395 Points

Thanks for the suggestions! :) I'll try them out.

Charles Massry
Charles Massry
12,253 Points

The problem is with TextEdit. Basically it saves your code in html format so you can view it in the browser, This is how you get it working like you want.

Mike Bronner
Mike Bronner
16,395 Points

Sounds like your answer fits best. I have never used TextEdit for web development, because it's so clunky. Thanks for linking to the knowledge base article. Learn something new every day. :)

Thank you! :)