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 trialPaul O'Connor
Courses Plus Student 2,510 PointsAt the stage where I am testing my HTML in the W3C Validation Service and am getting an error message
I am at the stage in Nick's Front End Web Design course where I am validating the code on the W3C validation Service. In the video Nick's code passes fine, in my test I am getting an error message that is specific to the Google Font link that I copy and pasted in.
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.
I suppose my question is - what do I have to do to alter the code to clear this error? Any help or advice will be gratefully received, thanks.
4 Answers
Gavin Ralston
28,770 PointsWell, it's pointing you to this line of code:
<link href='http://fonts.googleapis.com/css?family=Changa+One|Open+Sans:400,400italic,700,700italic,800' rel='stylesheet' type='text/css'>
See that pipe character? |
That's your problem. Replace the | with %7C
Just replace it like so:
<link href='http://fonts.googleapis.com/css?family=Changa+One%7COpen+Sans:400,400italic,700,700italic,800' rel='stylesheet' type='text/css'>
Gavin Ralston
28,770 PointsLooks like this has come up a few times in the HTML forum on Treehouse already.
John Mueller
719 PointsGavin Ralston I had the same problem with http://fonts.googleapis.com/css?family=Changa+One|Open+Sans:400italic,700italic,400,700,800 line but I'm curious as to why the %7 works. I copy and pasted the code from Google Fonts instelf.
Paul O'Connor
Courses Plus Student 2,510 PointsThanks to those who answered (Gavin, your right I should have checked the forum first before posting).
kjvswift93
13,515 PointsHi, I have struggled for a long time attempting to understand why the google fonts url reference line of code had an illegal "query". What exactly does %7C mean, what is it's function, and why/how is it different from the pipe character?
Yolvi Heredia
Courses Plus Student 3,604 PointsThanks Gavin Ralston!!
Hugo Paz
15,622 PointsHugo Paz
15,622 PointsHi Paul,
Could you please post your head code here?