没有协议的链接是否有效XHTML?即< a href =" // www.example.com/"> [英] Is a link without the protocol valid XHTML? i.e. <a href="//www.example.com/">

查看:137
本文介绍了没有协议的链接是否有效XHTML?即< a href =" // www.example.com/">的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

获得以下表单的链接是否有效XHTML /良好做法?
//www.example.com/foo/bar.html

Is it valid XHTML / good practice to have links of the following form? //www.example.com/foo/bar.html

如果当前页面是HTTP,则链接指向: http://www.example.com/foo/bar.html
如果当前页面是在HTTPS下保护,然后链接指向: https://www.example.com/foo/bar .html

If the current page is HTTP, then the link points to: http://www.example.com/foo/bar.html If the current page is secured under HTTPS, then the link points to: https://www.example.com/foo/bar.html

换句话说,是


< a href =// www.example.com />

<a href="//www.example.com/">

在XHTML 1.1 Strict 中有效?并且,它是否受到许多/所有浏览器的支持?

valid in XHTML 1.1 Strict? And, is it supported by many/all browsers?

推荐答案


它是否有效XHTML

Is it valid XHTML

完全。 XHTML不关心URI的语法。 href属性定义为包含CDATA。

Completely. XHTML doesn't care about the syntax of URIs. The href attribute is defined as containing CDATA.


在XHTML 1.1 Strict中有效吗?

valid in XHTML 1.1 Strict?

没有这样的语言。

XHTML 1.0有Strict / Transitional / Frameset版本。

XHTML 1.0 has Strict / Transitional / Frameset versions.

XHTML 1.1只是XHTML 1.1。 (并且 rfc2854 不会因为text / html(你需要它)而受到祝福IE< 9支持))。

XHTML 1.1 is just XHTML 1.1. (And isn't blessed by rfc2854 for serving as text/html (which you need for IE < 9 support)).


并且,它是否受到许多/所有浏览器的支持?

And, is it supported by many/all browsers?

是的。支持很好。

这篇关于没有协议的链接是否有效XHTML?即&lt; a href =&quot; // www.example.com/&quot;&gt;的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆