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 trialJacqueline Grubb
2,343 PointsWhy, when using multiple Google Fonts, do I receive a W3C error during html validation?
I selected 2 different fonts when visiting the Google Font site. I copied the code provided by google into the <head> on my index.html page. When I went to validate the html, I received an error stating that there was something wrong with the final ">". When I eliminated the 2nd font family from the single line of code (and "|" characters), and added it in as a second line (now having 2 lines of code to add the two font families separately) the validation was successful. Any ideas why I might have received this error? Here's the code from google: <link href='http://fonts.googleapis.com/css?family=Roboto:300italic,400,500,700|Pacifico' rel='stylesheet' type='text/css'>
1 Answer
Ryan Field
Courses Plus Student 21,242 PointsHi, Jacqueline. You're absolutely right that it's the pipe character that's causing this. The reason is because W3C's validation service prefers non-alphanumeric characters to be encoded as NFC. You can use your previous one-line version of Google fonts, and if you replace the pipe character with %7C
it should pass with no problems. :)
Jacqueline Grubb
2,343 PointsJacqueline Grubb
2,343 PointsThanks Ryan. I read the W3C info over and over and it didn't make sense. Your response cleared it right up! Appreciate the help.