我的HTML发生了什么?

时间:2010-04-21 02:22:09

标签: php html validation doctype

我正在对我的网站进行更改,我发现事情看起来有所不同。在IE中,内容不居中,我的内容有余量,而且字体在chrome中看起来更大..

我通过Yahoo的HTML验证器运行它,我得到的错误是line 1 - Error: character "" not allowed in prolog。我相信在DOC TYPE之前可能会发送某种空格,但我似乎无法修复它。 HTML在我的文本编辑器(Notepad ++)中看起来很好,所以我不知道问题是什么。我正在使用严格的DOC类型。在我做出任何改变之前一切都很好,但我无法确定是什么导致了这种变化。

如果有帮助,我正在使用框架(Kohana)。我最初的想法是通过回声或其他东西将某些东西发送到浏览器,但我找不到任何回声。

我不知道是什么导致这种情况...如果你想查看任何代码或HTML只是问。

以下是通过Google Chrome中的网页来源的HTML(仅限主题和文档类型)

源头中似乎有一些我以前从未见过的外国人物,但是没有出现在其他任何地方(雅虎或其他)

<!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> 
    <title>Recent Debates - Clashing Thoughts</title> 

    <meta http-equiv="Content-type" content="text/html; charset=utf-8" />
    <meta http-equiv="Content-Language" content="en-us" />
    <meta name="description" content="Clashing Thoughts is a great place to argue! Search topics you feel passionate about, pick where you stand on the issue and get your point across. The votes are tallied up for every debate so you can even see which side is most popular." />
    <meta name="keywords" content="debates, arguments, topics, popular topics, popular debates, surveys, choices" />
    <link rel="stylesheet" type="text/css" href="http://localhost/css/master.css" media="screen" /> 
    <link rel="stylesheet" type="text/css" href="http://localhost/css/clashingthoughts.css" media="screen" /> 
    <link rel="icon" type="image/x-icon" href="http://localhost/images/favicon.ico" /> 
    <link rel="shortcut icon" type="image/x-icon" href="http://localhost/images/favicon.ico" /> 
    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script> 

</head> 

1 个答案:

答案 0 :(得分:5)

您的来源是否可能保存在“UTF8 BOM”中?这不是第一次领先的BOM角色绊倒解析器。尝试将其保存为“UTF8 no-BOM”(可能在编辑器中以不同方式调用)。

相关问题