W3C validation error: "NET-enabling start-tag not immediately followed by null end-tag" and others
I have the following code that's giving me errors when being validated:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Language" content="en-us" />
<title>Welcome</title>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
开发者_运维技巧 <meta name="description" content="something..." />
<meta name="keywords" content="a,b,c,d" />
<link rel="stylesheet" type="text/css" href="/style.css" />
</head>
Here is how it's being parsed by the validator:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Language" content="en-us" />
<title>Welcome</title>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<meta name="description" content="something..." />
<meta name="keywords" content="a,b,c,d" />
<link rel="stylesheet" type="text/css" href="/style.css" /style.css />
</head>
What makes the site add additional and unquoted "/style.css" into the tag? How can I avoid this?
Thanks.
You've probably added /style.css
by accident (I cannot produce your result).
Visit the validator at: http://validator.w3.org/#validate-by-input
Copy-paste the contents of the code below:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Language" content="en-us" />
<title>Welcome</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><!-- <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" /> -->
<meta name="description" content="something..." />
<meta name="keywords" content="a,b,c,d" />
<link rel="stylesheet" type="text/css" href="/style.css" />
</head>
<body></body></html>
Result: The uploaded document was successfully checked as XHTML 1.0 Strict.
精彩评论