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 HTML Introduction Global Structure: Part 2

Web browser

Hello everyone,

Does anyone know why all of the code is showing in the web browser instead of the title and body information?

I'm using the TextEdit application installed in my MacBook.

8 Answers

Stone Preston
Stone Preston
42,016 Points

I would probably just use a different text editor, text edit doesnt seem to be a very good option. You can use Sublime Text 2 which is what the Treehouse instructors use in the videos. Its free to use (somewhat, occasionally you will get a popup asking you to purchase, but you can just cancel it and it will go away. Although if you end up using it a lot Id recommend buying it to support the development of the application)

Stone Preston
Stone Preston
42,016 Points

make sure you saved your file with a .html extension and not something like .html.txt. It might try and save it as a text file by default so you might have to change it when you select save as

```Thanks Stone! I just double checked to make sure it was properly saved. It is still showing all of my code. Do you know of other reasons it will still show all of the code. I'm going through the video and here's what I have so far. It's just like the video.

<!doctype html>

<html lang=“en”> <head> <meta charset=“utf-8”> <title>My Page</title> </head> <body> <div>This is a <span>div</span>.</div> <span>This is a span.</span>

</body>

</html>

it appears copying the code into the message boxes doesn't work so well :)

Stone Preston
Stone Preston
42,016 Points

you have to format your code using markdown. see the tips for asking questions video on the right side of the page for instructions on how to properly format it

Here it is!

''' <!doctype html>

<html lang=“en”> <head> <meta charset=“utf-8”> <title>My Page</title> </head> <body> <div>This is a <span>div</span>.</div> <span>This is a span.</span>

</body>

</html>

'''

<!doctype html>

<html lang=“en”>
    <head>
        <meta charset=“utf-8”>
        <title>My Page</title>
    </head>
    <body>
        <div>This is a <span>div</span>.</div>
        <span>This is a span.</span>

    </body>


</html>
Stone Preston
Stone Preston
42,016 Points

ok. It looks like its some TextEdit settings are preventing it from working correctly. Ive tried to get it work using text edit on my machine and fiddling with the settings and cant figure it out. The code works fine if I save it using Sublime Text 2. not sure what it is.

Thanks Stone, greatly appreciated, I'll try Sublime Text 2. I'm just getting started with trying to learn code. It's a new world for me.

McCoy