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 How to Make a Website HTML First Use HTML Elements

Christopher Ponce
Christopher Ponce
2,766 Points

Im adding a charset attribute but is not recognizing it

is there any way to type a code here because it doesn't display what i want

Hey Christopher,

I'm afraid your code doesn't display, can you re-post it?

8 Answers

Christopher Ponce
Christopher Ponce
2,766 Points

omg im such a noob, the problem was a space before the = thanks for the help everyone !!

Haha its a learning curve. And at least you now know how to post code to the forum

Every cloud has a silver lining =)

Hey Christopher,

That's known as a document type and lets your browser know what version of HTML the webpage is written in.

You need a charset:

<meta charset="utf-8">

This lets the browser know what character set to use. =)

Isaac Asante
Isaac Asante
4,752 Points

Hey Christopher, the charset attribute should be in the <head></head> section of your webpage. The charset attribute should also be added within a meta tag, exactly like this: <meta charset="UTF-8">

Keep in mind that the charset attribute DOES NOT change the layout of your webpage. The charset attribute only specifies the character encoding for the HTML document.

Christopher Ponce
Christopher Ponce
2,766 Points

thats what im typing on the challenge but it doesn't recognize it

Here is my code which works fine:

<!Doctype html>
<html>
  <head>
    <meta charset="utf-8">
  </head>
  <body>
  </body>
</html>

=)

Isaac Asante
Isaac Asante
4,752 Points

Your code at this part of the Code Challenge should be:

<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
  </head>

  <body>
  </body>


</html>
Christopher Ponce
Christopher Ponce
2,766 Points

how can i post a screenshot? but i don't think the code that you posted is not different from what im going to post.

You need to surround your code with these ```

If you cant find it on your keyboard, you can copy and paste is above and below your code, and this will wrap it to display like this

html
Christopher Ponce
Christopher Ponce
2,766 Points
<!Doctype html>
<html>
  <head>
    <meta charset ="utf-8">
  </head>
  <body>

  </body>
</html>
Christopher Ponce
Christopher Ponce
2,766 Points

is there something wrong with my code?? or its a browser compatibility problem ??

Hey Chris,

They arent double quotation marks, they are the back quote key. Mine is located on the keyboard key with three symbols although yours could be different.

Try to copy my three ``` and past them into your post =)

Nice job debugging your own code! That is a major skill to learn. As I have gone through the courses, I have learned that my problems aren't caused by not understanding the concept, but mistyping the code OR not understanding the syntax. Happy Coding!

Christopher Ponce
Christopher Ponce
2,766 Points

for me it's vice versa I'm very good with the syntax but it's kinda hard for me to understand the concepts. hey but thanks!! :D