Google字体网址在w3.org上打破HTML5验证 [英] Google fonts URL break HTML5 Validation on w3.org
本文介绍了Google字体网址在w3.org上打破HTML5验证的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我使用此HTML标记加载了3种不同大小的字体:
< link rel =stylesheettype = text / csshref =http://fonts.googleapis.com/css?family=Open+Sans:400,600,300,800,700,400italic|PT+Serif:400,400italic|Bree+Serif>
直到1/1个星期前, w3.org validator for HTML5;现在它出现此错误:
第14行,第163列:错误值http://fonts.googleapis.com/css? family = Open + Sans:400,600,300,800,700,400italic | PT + Serif:400,400italic | Bree + Serif元素链接上的属性href:查询中的非法字符:不是URL代码点。
W3C标记验证器现在不喜欢什么?
<对href属性(
%7C)中的 |
(管道字符)进行Url编码
): < link rel =stylesheettype =text / csshref = http://fonts.googleapis.com/css?family=Open+Sans:400,600,300,800,700,400italic%7CPT+Serif:400,400italic%7CBree+Serif\">
I load 3 fonts in different sizes using this HTML tag:
<link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=Open+Sans:400,600,300,800,700,400italic|PT+Serif:400,400italic|Bree+Serif">
Till ~1/2 weeks ago this was supported by w3.org validator for HTML5; now it gives this error:
Line 14, Column 163: Bad value http://fonts.googleapis.com/css?family=Open+Sans:400,600,300,800,700,400italic|PT+Serif:400,400italic|Bree+Serif for attribute href on element link: Illegal character in query: not a URL code point.
What's the things the W3C Markup Validator does not like now?
解决方案
Url encode the |
(pipe characters) in the href attribute (%7C
):
<link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=Open+Sans:400,600,300,800,700,400italic%7CPT+Serif:400,400italic%7CBree+Serif">
这篇关于Google字体网址在w3.org上打破HTML5验证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文