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

Any assistance! My html isn't displaying in browser properly

To whom this may reach! I'm very new to Treehouse and am eager to learn about this

I would love some help from perhaps some more experienced users. I have just followed exactly what was explained in the introduction to HTML, e.g.

<!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>

however, when opening this HTML file in a browser mine displays the entire body of text I am working on a Mac, using TextEdit, I'm not sure if i've misspelt anything in my html doc, but what is shown when open is not what is shown in the video, the video displayed simply

My Page, as the title and This is a div.

But mine is showing the entire body of text from the TextEdit doc.

Is the problem due to the spacing or anything? That was one thing not quite mentioned, are the different sized Margins simply a different about of TAB spaces??

Any help would be much appreciated. t_neumann-01@hotmail.com

Mårten Björk
Mårten Björk
3,776 Points

Hi! Welcome to Treehouse! Your question is very well-written, but I suspect some HTML was filtered out by the comment box. To write code that is visible to others in the forum, please place ``` before and after the code.

<div><span>Hello</span></div>

Could you please try to update your post like this?

3 Answers

Samuel Johnson
Samuel Johnson
9,152 Points

So when you try to open the file is it loading up with the text editor?

If that is the case then try to right click the file and open it with your browser; chrome,firefox, etc...

It may be that your text editor is set to open .HTML files by default?

Nachiket Kumar
Nachiket Kumar
3,590 Points

Your code looks fine and works fine too. What have you saved the file as? It needs to be saved as a .html file, might be stating the obvious but I can't think of why else it might not work?

Well, did you remember to use the correct file extension? (Either .html or .htm will work).