在另一个“< a>”内有一个< a>可以吗? [英] Is it ok to have an `<a>` inside another `<a>`?

查看:220
本文介绍了在另一个“< a>”内有一个< a>可以吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我有一个链接到另一个页面,并且另一个链接放在里面,那可以吗?它允许HTML5,如果是这样,哪些浏览器支持它?

If I had a link to another page, and another link was put inside it, would that be ok to do? Is it allowed in HTML5 and if so, which browsers support it?

在Chrome 14.0.835.202中尝试此操作,我看到左侧的文本被链接,后面跟着#1 链接,但其他链接不会被链接。

Trying this in Chrome 14.0.835.202, I see the text on the left gets linked, followed by the #1 link, but the rest doesn't get linked.

示例:

<p>
 <a href="download?file=2">Example file.txt</a>
 [
  <a href="revision?file=2&id=8">This is an example revision that fixes bug 
   <a href="bug?file=2&id=1">#1</a>. 
   Version number updated.
  </a>
 ]
</p>


推荐答案

根据链接HTML5的W3C规范:否。


内容模式:

透明,但不能有交互式内容后裔。

Content model:
Transparent, but there must be no interactive content descendant.

这篇关于在另一个“&lt; a&gt;”内有一个&lt; a&gt;可以吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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