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

Bruce McMinn
Bruce McMinn
10,030 Points

W3C validator doesn't like Google font?

I'm doing the "How to Make a Website" course. When I ran my index.html through the validator at W3C I got an error message. I tried changing the font families I was using and got the same thing. Looks great when I preview the workspace, and the font changed when I switched font families in the code. Here is the response I got:

Error Line 7, Column 123: Bad value http://fonts.googleapis.com/css?family=Ubuntu:400,500|Oxygen:400,300,700 for attribute href on element link: Illegal character in query: not a URL code point. …css?family=Ubuntu:400,500|Oxygen:400,300,700' 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.

3 Answers

It doesn't like the | attribute. Use this '%7C' instead.

Bruce McMinn
Bruce McMinn
10,030 Points

Worked great.

How did you know this?

Try http://fonts.googleapis.com/css?family=Ubuntu:400,500%7COxygen:400,300,700

It is the pipe " | " character that the validator not like, replacing it with %7C will fix you issue.

Bruce McMinn
Bruce McMinn
10,030 Points

Worked great.

How did you know this?

Personal experience with the aid of google.

Bruce McMinn
Bruce McMinn
10,030 Points

Of course. I often use Google for error messages but didn't know how to query this one. Thanks Dan.