< a>中可包含哪些元素?标签? [英] What elements can be contained within a <a> tag?

查看:190
本文介绍了< a>中可包含哪些元素?标签?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的谷歌今天晚上没有抓起来。什么是可以包含在< a> 标签中的有效html元素?

 < a> ?? < / A> 


解决方案 span,strong,em 等)可以包含其他内联元素和文本节点。


通常,块级元素
可以包含内联元素和其他
块级元素。通常,
内联元素可能只包含数据
和其他内联元素。
固有的结构区别是
的概念,块元素创建
更大的结构,而不是内联
元素。

http://www.w3.org /TR/html401/struct/global.html



正如其他答案中所指出的,您不能在 a a 中。


My google fu is not up to scratch this evening. What are the valid html elements, if any, that can be contained within a <a> tag?

<a> ?? </a>

解决方案

Inline elements ( a, span, strong, em among others ) can contain other inline elements and text nodes. An anchor can contain a span, which can contain a text node.

Generally, block-level elements may contain inline elements and other block-level elements. Generally, inline elements may contain only data and other inline elements. Inherent in this structural distinction is the idea that block elements create "larger" structures than inline elements.

From http://www.w3.org/TR/html401/struct/global.html

As noted in other answers, you can't nest an a in an a.

这篇关于&lt; a&gt;中可包含哪些元素?标签?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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