HTML How to Make a Website Responsive Web Design and Testing Website Testing

Heidi Vasterling-Ford
Heidi Vasterling-Ford
7,803 Points

When I checked my website the checker said "error" because of using "|" in the href for the font I chose. How do I fix?

I chose a different font from the one the teacher provided; here is the code: <link href="https://fonts.googleapis.com/css?family=Crimson+Text:400,400i,700|Nunito:300,400,700" rel="stylesheet">

Validator.w3 gave me an error because of the "|" used before 'Nunito' How do I fix this?

3 Answers

Ash Mac
Ash Mac
852 Points

Sometimes validator will show these things, but as long as you know what they are and they are correct, they don't need to be fixed

andren
andren
28,366 Points

As Ash mentions minor errors like that won't realistically cause you any actual issues, but you can fix it pretty easily if you really want your site to be 100% HTML compliant. The reason it complains is that URLs are only supposed to use characters found in the ASCII standard, any characters outside of it should be represented by an UTF-8 Character Code.

The UTF-8 code for the | symbol is 7C and to indicate you are using a UTF-8 code in the URL you have to prepend a % sign. Put a bit more simply you just need to replace the | with %7C in the URL like this:

 <link href="https://fonts.googleapis.com/css?family=Crimson+Text:400,400i,700%7CNunito:300,400,700" rel="stylesheet">

That way the URL will still work the same, but be completely standards compliant.