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 trialNick Johnson
Courses Plus Student 193 PointsSet the character set for the page.
Hi,
It is saying I have done this incorrect but I can not work out where. Any help would be great thanks.
Many thanks
Nick
<!DOCTYPE html>
<html>
<head>
<meta charaset="utf-8">
<title>Nick Johnson | Designer</title>
</head>
<body></body>
</html>
3 Answers
Jon Mirow
9,864 PointsHi there!
Really close, it's just a small typo. characters are often shortened in programming to "char" so, the line should say "charset" not "charaset"
Hope it helps :)
Ashish Kayastha
Courses Plus Student 417 PointsI am not sure where I am doing wrong here. <!DOCTYPE html> <html> <head> <meta charset = "utf-8"> <title> aksar | Designer </title> </head> <body> <header> </header> </body> </html>
Jon Mirow
9,864 PointsHi Ashish Kayastha
It looks like you have spaces around your = sign in the meta tag. This is often considered bad practice. You'll usually find that most if not all browsers are able to handle what's called "white space" between attributes and values, so it's unlikely that it wouldn't "work" in real life, however a couple of things to consider:
Firstly, remember that inside html elements, attributes such as id, class or charset are separated from each other by a single space, so it can be a bit more difficult to read if all the attributes and values aren't visibly grouped.
Secondly, and more importantly, we really want to keep as few non-content characters on the page as possible. Every space character in UTF-8 encoding takes up 1 byte in size. Having them either side of the equals sign is an extra 2 bytes per attribute. If you then multiply that by potentially hundreds of id, class, src, name, value, attributes on a page, it could add up to kilobytes of size across a website, which may slow down page loading. Additionally when you factor in thousands of users visiting the page every day, somehow our little spaces are contributing to gigabytes of data per month, and larger websites have to pay for the size of traffic that visits them.
So TL;DR: You may not necessarily need to remove spaces between attributes and values, but it's a good idea to, so that's probably why the checker is so strict here - remove any "bad habits" before they form :)
Hope it helps!