Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

CSS How to Make a Website Responsive Web Design and Testing Website Testing

David DeWeaver
David DeWeaver
3,701 Points

One 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
Colin Bell
29,679 Points

Replace 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
David DeWeaver
3,701 Points

Thank you Colin! I would never have caught that error. Does the | symbol never work in html?

Colin Bell
Colin Bell
29,679 Points

It'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.

Yeah, if you have the same problem, just change your '|' symbol in this line on '%7C'. That's the point!