标题内的链接或链接标题中的HTML标记? [英] Header inside Link or Link inside Header in HTML markup?
问题描述
可能重复:
哪一个更正确:< h1>< a> ..< / a>< / h1> OR< a>< h1> ..< / h1>< / a>
语义上,这是更正确的:a在h2或h2在?
这是一个关于HTML的简单问题。
通过这种方式:
< h2>< a href =>有些标题< / a>< / h2>
或者这样:
< a href =>< h2>一些标题< / h2> ;< / a>
更好的是
< h2>< a href =>有些标题< / a>< / h2>
因为 h
在 a
元素中加入 block
并不是好习惯。
Possible Duplicate:
Which is more correct: <h1><a>..</a></h1> OR <a><h1>..</h1></a>
Semantically, which is more correct: a in h2, or h2 in a?
This is a simple question about HTML. What is the right/most preferable way to put a link in a header, paragraph or another HTML element?
This way:
<h2><a href="">Some Title</a></h2>
Or this way:
<a href=""><h2>Some Title</h2></a>
Better is
<h2><a href="">Some Title</a></h2>
because h
is element with display block and is not good practice to have block
in a
element.
这篇关于标题内的链接或链接标题中的HTML标记?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!