Attribute "lang" exists, but can not be used for this element.? W3C validation error

213 Views Asked by At

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?

2

There are 2 best solutions below

0
On

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

2
On

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]).