<分区>
我问这个是因为我有一些链接就像按钮一样,可以通过 ajax 提取内容,所以我不需要任何 href。
(我是从 SEO 角度问的)
<分区>
我问这个是因为我有一些链接就像按钮一样,可以通过 ajax 提取内容,所以我不需要任何 href。
(我是从 SEO 角度问的)
最佳答案
我假设“链接”只是指 a
元素。如果这是真的,那么:
没有。至少,不在 HTML5 draft specification 中:
If the a element has no href attribute, then the element represents a placeholder for where a link might otherwise have been placed, if it had been relevant.
Authors may also create an A element that specifies no anchors, i.e., that doesn't specify href, name, or id. Values for these attributes may be set at a later time through scripts.
关于html - 链接上需要 href 吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8970767/