1

我在客户的网站上执行了 W3C HTML 验证,它说我过早地关闭了标头标记。这给出了错误,指出我已将元和链接标签放在标题之外。

有人可以告诉我的标题有什么问题吗?

警告:成人网站 NSFW

验证: http: //validator.w3.org/check ?uri=http%3A%2F%2Fwww.hush-hush.com%2F1stflick%2F&charset=%28detect+automatically%29&doctype=Inline&group=0&ss=1

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
    <title>Nude Teen Videos | 1st Flick - Week 624</title>

    <script type="text/javascript">
        var _gaq = _gaq || [];
        _gaq.push(['_setAccount', 'UA-22415623-1']);
        _gaq.push(['_trackPageview']);
        (function() {var ga = document.createElement('script');
        ga.type = 'text/javascript'; ga.async = true;
        ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
        var s = document.getElementsByTagName('script')[0];
        s.parentNode.insertBefore(ga, s);
        })();
    </script>

    <meta name="google-translate-customization" content="c6d5b23c329fcd9b-06d3de73510dc63e-g0ea7962122bd05dd-11"></meta>

    <!-- Start Alexa Certify Javascript -->
        <script type="text/javascript">_atrk_opts = { atrk_acct:"9AYbi1acVE0008", domain:"hush-hush.com",dynamic: true};
            (function() { var as = document.createElement('script');
            as.type = 'text/javascript';
            as.async = true;
            as.src = "https://d31qbv1cthcecs.cloudfront.net/atrk.js";
            var s = document.getElementsByTagName('script')[0];
            s.parentNode.insertBefore(as, s);
            })();
        </script>
        <noscript>
            <img src="https://d5nxst8fruw4z.cloudfront.net/atrk.gif?account=9AYbi1acVE0008" style="display:none" height="1" width="1" alt="" />
        </noscript>
    <!-- End Alexa Certify Javascript -->

    <meta content="text/html; charset=utf-8" http-equiv="Content-Type"/>
    <link rel="stylesheet" href="/css/screen.css" type="text/css" />
    <!--[if IE 6]>
        <link rel="stylesheet" type="text/css" href="/css/ie6.css" media="screen"/>
        <script defer type="text/javascript" src="/js/pngfix.js"></script>
    <![endif]-->
    <!--[if IE 7]>
        <link rel="stylesheet" type="text/css" href="/css/ie7.css" media="screen"/>
    <![endif]-->

    <script type="text/javascript" src="/js/script.js"></script>

    <link rel="alternate" title="Hush-Hush Galleries: News &amp; Updates" href="http://www.hush-hush.com/feed.xml" type="application/rss+xml" />
    <meta name="Description" content="1st Flick amateur teen video download. Submit vid to win password or cash."></meta>
    <meta name="KEYWORDS" content="movies, movie, video, videos, softcore, 1st Flick, teen, download, password, bedroom, amateur, adult, voyeur, downblouse, nipple, nipple slip, nip slip, upskirt, hidden camera, topless, celebrity nude"></meta>
    <script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js" ></script>
</head>
<body>
...
4

3 回答 3

3

<noscript>不允许元素作为元素的子<head>元素。它们只能出现在<body>元素中。

于 2013-11-14T01:46:39.113 回答
1

你为什么不把它移到<noscript>身体里呢?

于 2013-11-14T20:25:27.983 回答
1

HTML 4.01(或XHTML 1.0)中,该noscript元素不得在headelement中使用。

HTML5中是允许的:

noscript元素
[…]
可以使用此元素
上下文: 在headHTML 文档的元素中,如果没有祖先noscript元素。

但请注意,如果在 中使用head,则不得包含除 、 或 之外的任何link其他style元素meta。因此,您不能将ìmg元素用作 child

XHTML5中是不允许的。


标签会<noscript>过早关闭标题吗?

大概。如果解析器找到一个noscript元素,它假定body必须已经开始。但当然有可能一切都按预期工作(除了无效)。

我认为noscriptbody.

于 2013-11-14T09:33:28.073 回答