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 1

Charles Harpke
Charles Harpke
33,986 Points

Code in webpage

my code: <!doctype html>

<html lang=“en”> <head> <meta charset=“utf-8”>
</head>

</html>

renders in the web browser. Is this this normal for this to display in the browser? I''m using TextEdit....

Brett Kim
Brett Kim
11,576 Points

No, <!DOCTYPE html> shouldn't be showing up. Did you use all caps?

12 Answers

Hi Charles,

Textedit is a word processor and that may be your problem. It might require you to set it up properly to handle text files. You may want to switch to a dedicated text editor like sublime text.

Brett Kim
Brett Kim
11,576 Points

<!DOCTYPE html> should not be showing up. Does your code like like <!doctype html> or like <!DOCTYPE html>? Is <!DOCTYPE html> at the beginning or the end?

Charles Harpke
Charles Harpke
33,986 Points

<!DOCTYPE html> is all lower case and appears at the beginning....

Brett Kim
Brett Kim
11,576 Points

Try using uppercase. if that still doesn't work, send me your code

<!DOCTYPE html>

Charles Harpke
Charles Harpke
33,986 Points

Code is still rendering in the page....here is my code: <!DOCTYPE html>

<html lang=“en”> <head> <meta charset=“utf-8”> <title>My Page</title>
</head> <body> <h1>This is a level 1 headline</h1>

 <p>Sample Text  
 </p>

p>Sample Text    
 </p>


p>Sample Text    
 </p>


</body>

</html>

Brett Kim
Brett Kim
11,576 Points

Duplication Glitch

Brett Kim
Brett Kim
11,576 Points

Note to self: Do not press the answer button seven times over and over again... :O

Brett Kim
Brett Kim
11,576 Points

I wish Treehouse added a Delete answer because my answer duplicated like 10 times

Brett Kim
Brett Kim
11,576 Points

Duplication Glitch

Brett Kim
Brett Kim
11,576 Points

Duplication Glitch

Brett Kim
Brett Kim
11,576 Points

Sorry, mega duplication glitch!!!

Charles Harpke
Charles Harpke
33,986 Points

<!DOCTYPE html> is all caps....code still appears on the page...

Charles Harpke
Charles Harpke
33,986 Points

Code renders as expected in CodePen. However, Safari, Chrome, IE and Firefox all display: <!DOCTYPE html>

<html lang=“en”> <head> <meta charset=“utf-8”> <title>My Page</title>
</head> <body> <h1>This is a level 1 headline</h1> <h2>This is a level 2 headline</h2> <h3>This is a level 3 headline</h3> <h4>This is a level 4 headline</h4> <h5>This is a level 5 headline</h5> <h6>This is a level 6 headline</h6>

<p>Sample Text   
</p>

p>Sample Text    
</p>


p>Sample Text    
</p>


</body>

</html>

Charles Harpke
Charles Harpke
33,986 Points

TextMate works for proper rendering thanks guys.....

Charles Harpke you must type doctype in ALL CAPS like <!DOCTYPE html> You're page will be completely blank.