Webkit moves head content to body, and adds extra space?

老子叫甜甜 提交于 2020-01-13 06:34:07

问题


It seems Webkit moves all my head tags to the body, and adds a lot of whitespace before the body. When I look at the source, the tags are in the right place. When I inspect the elements using the Chrome browser, the tags have been moved. I suspect it's Webkit because the same happened in Safari, but not in Opera or Firefox. I use the latest of all browsers.

Here is my source code start, as appears when I press "Show Source":

<!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">

<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="description" content="(Snip)" />

    <title>(Snip)</title>

    <link rel="shortcut icon" href="favicon.ico" />

    <link rel="stylesheet" type="text/css" href="style/qtip.css" />
    <link rel="stylesheet" type="text/css" href="style/jquery-ui.css" />
    <link rel="stylesheet" type="text/css" href="style/new.css" />

    <script type="text/javascript" src="javascript/ckfinder/ckfinder.js"></script>
    <script type="text/javascript" src="javascript/jquery.js"></script>
    <script type="text/javascript" src="javascript/jquery_easing.js"></script>
    <script type="text/javascript" src="javascript/jquery_custom.js"></script>
    <script type="text/javascript" src="javascript/typewatch.js"></script>
    <script type="text/javascript" src="javascript/ckeditor/ckeditor.js"></script>
    <script type="text/javascript" src="javascript/ckeditor/adapters/jquery.js"></script>
    <script type="text/javascript" src="javascript/slider.js"></script>
    <script type="text/javascript" src="javascript/script.js"></script>
    <script type="text/javascript" src="javascript/qtip.js"></script>
    <script type="text/javascript" src="javascript/swfobject.js"></script>
</head>

<body>
            <div id="wrapper_ext">
            <a id="wallpaper_toggle"></a>
            ...

And here is a screenshot of the DOM analyser:

I suspected Javascript at first, but I disabled all Javascript and the same thing occurs. Yet, this only occurs on some of my pages, so I don't know the actual cause. I'm looking for possible causes of such a problem.


回答1:


I removed the Byte-Order Mask (BOM) from my file, and it worked. Should I report this as a bug to webkit?



来源:https://stackoverflow.com/questions/8856573/webkit-moves-head-content-to-body-and-adds-extra-space

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!