html - 链接上需要 href 吗?

标签 html hyperlink 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.

来自HTML 4.01 specification :

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/

相关文章:

html - Bootstrap 3 : add icon outside of input

html - 在 Bootstrap 中调整图像大小和填充

javascript - Angular:仅对 html 表单的某些部分启用表单输入

html css链接到另一个链接

.htaccess URL 重写规则

javascript - 画廊的图像预加载器一张一张?这有什么问题吗?

vb.net - 在word中添加超链接,使用vb.net

c# - 在 WPF 中使用超链接的示例

java - 搜索引擎优化,谷歌抓取

php - 用于 Google 抓取目的 : Single PHP pull-page, 或每个不同项目的单独页面?