【发布时间】:2014-03-30 21:28:20
【问题描述】:
我正在 w3 学校网站上学习 html,我在“html 链接”一章。我不明白的是为什么他们建议在链接标签中使用 id 属性而不是标题标签。
他们的榜样:
<p>
<a href="#C4">See also Chapter 4.</a>
</p>
<h2><a id="C4">Chapter 4</a></h2>
<p>This chapter explains ba bla bla</p>
我的尝试:
<p>
<a href="#C4">See also Chapter 4.</a>
</p>
<h2 id="C4">Chapter 4</h2>
<p>This chapter explains ba bla bla</p>
当我尝试它们时,两者的工作方式相同,但我的尝试需要更少的写作。我的尝试中是否有我不明白的错误。
【问题讨论】:
-
有很多,很多东西wrong with that website。这只是过时做法的例子之一。使用
h3。