没有 href 和名称的 anchor 标记是否有效?在我们的应用程序中,我们有一些删除链接被禁用(因此没有 href
属性),但仍向用户显示。
我代表 Joshua Muheim 发布这个问题在 comments of a related question 中被问到.它与原始问题非常相似,但差异很大,我觉得值得将它作为一个单独的问题打开。
最佳答案
是的,它是有效的,the HTML spec says :
If the
a
element has nohref
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.
关于html - 具有没有 href 且没有名称的 anchor 标记是有效的 HTML 吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16302694/