如果< a name =“...”>>已经过时,什么是首选? [英] If <a name="..."> is obsolete, what is preferred?

查看:116
本文介绍了如果< a name =“...”>>已经过时,什么是首选?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

HTML代码< a name =some_bookmark> text< / a> 对于创建指向页面特定部分的链接非常有用(例如 page.html中#some_bookmark )。但是,W3C规范现在将 a 标签的名称属性标记为过时。



如果是这种情况,那么优先选择什么?是否有新的< bookmark> 标签或类似的标签?

您可以在任何元素上放置一个 id =属性,它的效果会相同。



这些是通常放在标题元素上。

The HTML code <a name="some_bookmark">text</a> is very useful for creating links to specific sections of a page (e.g., page.html#some_bookmark). However, the W3C spec now marks the name attribute of the a tag as "obsolete."

If this is the case, then what is preferred? Is there a new <bookmark> tag or similar?

解决方案

You can place an id="" attribute on any element and it will have the same effect.

These are typically placed on heading elements.

这篇关于如果&lt; a name =“...”&gt;&gt;已经过时,什么是首选?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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