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 Responsive Web Design and Testing Website Testing

Jacob Thomson
Jacob Thomson
757 Points

Help understanding why my html is invalid?

I copied and pasted my html from my 'index.html' file into http://validator.w3.org, and i received an error.

Error Line 7, Column 181: Bad value http://fonts.googleapis.com/css?family=Swanky+and+Moo+Moo|Roboto+Condensed:400italic,400,700|Open+Sans:400italic,800italic,400,800 for attribute href on element link: Illegal character in query: not a URL code point. ā€¦00,700|Open+Sans:400italic,800italic,400,800' rel='stylesheet' type='text/css'> Syntax of URL: Any URL. For example: /hello, #canvas, or http://example.org/. Characters should be represented in NFC and spaces should be escaped as %20.

This is the html it did not agree with, what do i need to change for it to be valid?

<link href='http://fonts.googleapis.com/css?family=Swanky+and+Moo+Moo|Roboto+Condensed:400italic,400,700|Open+Sans:400italic,800italic,400,800' rel='stylesheet' type='text/css'>

Thank you

3 Answers

Alex Heil
Alex Heil
53,547 Points

hey jacob, you don't have to change anything actually. The error message you receive for the google fonts is because of the "|" character used in it. you can verify this easily by removing these 2 characters in the w3c validator and you'll see that the code will pass.

hope that helps and have a nice day ;)

Hi Jacob,

The vertical bar is considered an unsafe character in a url. Unsafe characters should always be url encoded.

You can replace all occurrences of it with %7C This will fix the error.