开发者

W3C validation error: "NET-enabling start-tag not immediately followed by null end-tag" and others

开发者 https://www.devze.com 2023-04-10 07:25 出处:网络
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\">

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号