简体   繁体   English

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

[英]Attribute “lang” exists, but can not be used for this element.? W3C validation error

I'm using this dtd 我正在使用这个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? 我应该从DTD删除它吗?

Just use <doctype html> . 只需使用<doctype html> You're not using XML anyway, and the xml:lang attribute doesn't do anything in HTML. 无论如何,您都不使用XML,并且xml:lang属性在HTML中不执行任何操作。

I think this is it : 我认为是这样的

A. Changes from XHTML 1.0 Strict A.对XHTML 1.0严格的更改

1. On every element, the lang attribute has been removed in favor of the xml:lang attribute (as defined in [XHTMLMOD]). 1.在每个元素上,已删除lang属性,而使用xml:lang属性(在[XHTMLMOD]中定义)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM