没有href和没有名称的锚标签是否有效? [英] Is it valid HTML to have an anchor tag without href and without name?
问题描述
有效的HTML有没有href和没有名字的锚标签?在我们的应用程序中,我们有一些删除链接被禁用(因此没有 href
属性),但仍显示给用户。
我代表 Joshua Muheim ,这是在相关问题的评论中提出的。这与原来的问题非常相似,但不同的是,我觉得将它作为一个单独的问题打开是值得的。 div> 是的,它是有效的, HTML规范说: 如果 Is it valid HTML to have an anchor tag without href and without name? In our app we have some delete links which are disabled (hence no I am posting this question on behalf of Joshua Muheim which was asked in the comments of a related question. It is very similar to the original question, but different enough that I felt it was worthwhile to open it as a separate question. Yes it's valid, the HTML spec says: If the
这篇关于没有href和没有名称的锚标签是否有效?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
a
元素没有 href
属性,那么元素表示一个占位符,表示一个链接可能被放置的位置,如果它是相关的,则只包含元素的内容。
href
attribute), but still shown to the user.
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, consisting of just the element's contents.