问题描述
当我使用w3c验证器验证此页面时,我被告知名称属性已过时,但是,我找不到一个替代。我可以找到一个页面内链接的每篇文章似乎仍然指定使用name属性。在验证器(链接到id)上提到的方法似乎不适用于我。
When I validate this page with the w3c validator, I am told that "the name attribute is obsolete," however, I cannot find an alternative. Every article I can find about linking within a page still seems to specify using the name attribute. And the method that is mentioned on the validator (linking to an "id") doesn't seem to work for me.
任何人都知道正确的选择,或如何正确链接到一个id?
Anyone know the correct alternative, or how to correctly link to an id?
此外,我想能够链接到一个特定的点上面的锚点当前是...有任何更具体的页面滚动/跳转到哪里?
Also, I'd like to be able to link to a specific point just above where the anchor points currently are...is there any way to be more specific about where the page scrolls/jumps to?
推荐答案
具有指定标识符的任何元素,例如:
You can skip to any element with specified identifier like that:
<div id="navigation"></div>
<div id="content"></div>
<div id="footer"></div>
<a href="#navigation">Skip to navigation</a>
这篇关于属性“name”的正确替代方法是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!