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, validator error.

Hi,

After almost finishing my first course, I got 2 errors in my html. One was about google fonts, Nick included, the second one was about not using H tag in section area.

So I searched and found in forum answer how to fix validation of html about google font (problem was | and I swapped that character with %7C ). I added H3 tag under section to pass the validation.

My question is, do I use this new weird font code %7C on my website, to work properly (because on Nick's example I do not see this), so it will be without errors, and why google posts font links that don't pass validations?

Thank you for your answer

2 Answers

If you were to actually use that on a live website, it should work just fine. I also ran into the same error, and googled the solution (and probably found the exact same page as you, heh).

The validator is quite picky, and will point out every single error and warning. There's the possibility that some browser somewhere might not be able to interpret that character, but I think you're probably safe for most major browsers. That said, the fix is quite simple, so if you want to be 100% validated, then go ahead and use %7C. :)

Thanks for fast reply. Did you use %7C?

Web browsers are super forgiving, and the html validator is super picky. On my webpages I usually do change the google font lines to use %7C and any other such characters. Using those instead of the |, or %20 instead of spaces, etc, is a best practice and makes absolute sure stuff works. I've worked with some APIs that do insist on changing characters to those %xx style codes, so it's a good practice to do just in case it does matter.

Thanks Merritt, I will do the same ;)