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 trialDavid DeWeaver
3,701 PointsOne irritating Validation Error- Bad fonts?
When I take index.html to validator.w3.org, I always get one validation error that reads:
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.
Apparently when I included the Google fonts in my html file I did it incorrectly, but I revisited Nick's earlier video where he first showed us how to include fonts and I followed his directions. My code (and his) reads:
<link rel="stylesheet" href="css/normalize.css"> <link href='http://fonts.googleapis.com/css?family=Changa+One|Open+Sans:400italic,700italic,400,700,800' rel='stylesheet' type='text/css'> <link rel="stylesheet" href="css/main.css"> <link rel="stylesheet" href="css/responsive.css">
Can anyone provide advice on where the error is and how to fix it?
3 Answers
Colin Bell
29,679 PointsReplace the bar character that separates your two fonts with %7c
<link href='http://fonts.googleapis.com/css?family=Changa+One%7COpen+Sans:400italic,700italic,400,700,800' rel='stylesheet' type='text/css'>
<!-- ^ Here -->
David DeWeaver
3,701 PointsThank you Colin! I would never have caught that error. Does the | symbol never work in html?
Colin Bell
29,679 PointsIt's not a utf-8 character, so any time it's in the head - before the character set is declared - the validator will freak out.
At least I'm pretty sure, haha.
Vadim Dubkov
Courses Plus Student 849 PointsYeah, if you have the same problem, just change your '|' symbol in this line on '%7C'. That's the point!