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 Sharing a Website Find a Domain

Brian Coffelt
Brian Coffelt
12,071 Points

Can't figure out validator.w3.org HTML error

validator.w3.org found the an error with the following code:

<link href='http://fonts.googleapis.com/css?family=Changa+One|Open+Sans:400italic,700italic,400,700,800' rel='stylesheet' type='text/css'>

I've checked Nick Pettit's example several times & can't figure out the error. Let me know if more clarification is required.

5 Answers

Jean Paiva
Jean Paiva
7,128 Points

As I see...it's the " | " between the 2 fonts that's the problem.

Try to use the fonts separately, like this:

<link href='http://fonts.googleapis.com/css?family=Changa+One' rel='stylesheet' type='text/css'>

<link href='http://fonts.googleapis.com/css?family=Open+Sans:400italic,700italic,400,700,800' rel='stylesheet' type='text/css'>

Brian Coffelt
Brian Coffelt
12,071 Points

That solved it. Thanks again.

James Barnett
James Barnett
39,199 Points

Since | character is invalid in a URL, a better solution is to encode the | character by changing it to %7c

source: http://stackoverflow.com/a/22469221/1756132s

John Wheal
John Wheal
27,969 Points

Shouldn't you use double quotes? I'm not sure if that will cause an error with w3 validator.

I seem to think I've seen this issue before and it's related to the URL that Google has given you. It doesn't like | characters.

Brian Coffelt
Brian Coffelt
12,071 Points

I thought the same thing & changed to double quotes. The w3 validator still rejected it. Doubled-checked Nick Pettit's example. Thanks for the input.

Brian Coffelt
Brian Coffelt
12,071 Points

@Jean Paiva.....Thanks. I'll give it a try your way.