属性“lang”存在,但不能用于该元素。? W3C 验证错误

发布于 2024-08-18 23:01:37 字数 311 浏览 2 评论 0原文

我正在使用此 dtd

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html lang="en" xml:lang="en" xmlns="http://www.w3.org/1999/xhtml">

此属性有错误吗?

<html lang="en">

我应该从 DTD 中删除它吗?

I'm using this dtd

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html lang="en" xml:lang="en" xmlns="http://www.w3.org/1999/xhtml">

Error is for this attribute?

<html lang="en">

Should i remove this from DTD?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

新雨望断虹 2024-08-25 23:01:37

只需使用 。无论如何,您都没有使用 XML,并且 xml:lang 属性在 HTML 中不起任何作用。

Just use <doctype html>. You're not using XML anyway, and the xml:lang attribute doesn't do anything in HTML.

苯莒 2024-08-25 23:01:37

我认为就是这样

A.相对于 XHTML 1.0 严格的更改

<强>1。在每个元素上,lang 属性已被删除,取而代之的是 xml:lang 属性(如 [XHTMLMOD] 中定义)。

I think this is it:

A. Changes from XHTML 1.0 Strict

1. On every element, the lang attribute has been removed in favor of the xml:lang attribute (as defined in [XHTMLMOD]).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文