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

Angela Miller
Angela Miller
3,536 Points

code validation error message, what am I doing wrong?

I am nearing the end of "How to make a website" and have reached the step where you validate your code on validator.w3.org. I am receiving this error message:

Error Line 7, Column 142: Bad value http://fonts.googleapis.com/css?family=Changa+One|Open+Sans:400italic,700italic,400,700,800 for attribute href on element link: Illegal character in query: not a URL code point. …ne|Open+Sans:400italic,700italic,400,700,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.

From what I understand it does not like some part of the /css'> specifically, the > closing tag. I keep re-watching the fonts video, and from what I can see my code is exactly the same as Nick's, and I am doing it exactly the same. His code did validate and mine will not. What am I overlooking or not seeing here?

2 Answers

Ryan Field
PLUS
Ryan Field
Courses Plus Student 21,242 Points

Hi, Angela. This is actually a problem with the link URL that is used for Google fonts. Specifically, it's the pipe character (|) that is causing this message. If you replace it with %7C, it should validate properly.

Angela Miller
Angela Miller
3,536 Points

It worked! Thank you, i've been trying to solve that for the last 24 hours!

Ryan Field
Ryan Field
Courses Plus Student 21,242 Points

You're very welcome! I had the exact same issue when I took that course, and I remember it taking me a little while to solve. Your code, even without the change, would still be perfectly fine on the vast majority of browsers, though. Good luck with your coding! :)