xhtml - 为什么不建议将目标=“_blank”与XHTML一起使用?

标签 xhtml w3c-validation wcag xhtml-1.1

It's valid in XHTML 1.1和WCAG 2.0准则没有有关其用法的任何信息?

我知道在严格的XHTML 1.0中这是无效的,但是如果很多人都在使用其他功能,例如JavaScript,jQuery,rel属性,PHP等。

是否有意义?这意味着人们不想遵循验证规则,他们只是想跳过验证。

最佳答案

这主要与将内容与行为分开有关。基本前提是我们应该使用HTML/XHTML表示内容,使用CSS表示和布局,使用JavaScript进行交互。

target属性不适合此范例(这是一些HTML内容,会影响浏览器的行为),这就是为什么对其使用不赞成的原因。

关于xhtml - 为什么不建议将目标=“_blank”与XHTML一起使用?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2250195/

相关文章:

html - 能否通过 HTML 结构区分地标的重复使用?

html - 多个表头

html - CSS 帮助 - 如何在另一个 div 类型的右上象限中 float 一个 div?我需要做一个L形

jquery - 确定是否在页面加载时使用 jquery 选中复选框

html - 为什么 <p> 标签中不能包含 <div> 标签?

javascript - "The text content of element script was not in the required format: Expected space, tab, newline, or slash but found { instead."

jquery 选项卡 wcag 可访问性 : role presentation is not allowed for given element; Ensures role attribute has an appropriate value for the element

accessibility - WCAG 是否处理空/冗余元素?

ubuntu - 如何在 ubuntu 10.04 上安装 w3c 验证器

html - 验证错误 : "Byte-Order Mark found in UTF-8 File"