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

Matthew Schmitt
Matthew Schmitt
12,234 Points

Markup Validation

Not sure why I get this error on the w3c validation website. I don't quite understand what it means:

Line 8, Column 140: 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. ā€¦+One|Open+Sans:400italic,700italic,400,700,800'rel='stylesheet'type='text/css'>

Syntax of IRI reference: Any URL. For example: /hello, #canvas, or http://example.org/. Characters should be represented in NFC and spaces should be escaped as %20.

Here is the actual code from the website design lesson:

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

2 Answers

Nick Fuller
Nick Fuller
9,027 Points

I think the validator is angry about the pipe character in the URL string. There are strict rules about how a URL should be formatted. Now you can bend those rules and it will still work.

Try this and tell me if it validates?

<link href='http://fonts.googleapis.com/css?family=Changa+One%7COpen+Sans:400italic,700italic,400,700,800' rel='stylesheet' type='text/css'>
Matthew Schmitt
Matthew Schmitt
12,234 Points

Ah, nice! That worked. Thanks for the help!