douwen7603 2010-04-21 02:22
浏览 52
已采纳

我的HTML发生了什么?

I am making changes to my website, and I just noticed that things look different. In IE, the content doesn't center, there's a margin on my content, and the font looks bigger in chrome..

I ran it through Yahoo's HTML validator and the error I get is line 1 - Error: character "" not allowed in prolog. I believe that there may be some sort of whitespace being sent before the DOC TYPE, but I cant seem to fix it. The HTML looks fine in my text editor (Notepad++) so I don't know what the problem is. I'm using a strict DOC Type. Everything was fine before I made any changes, but I can't pinpoint what caused the change.

If it helps, I'm using a Framework (Kohana). My initial thought was that something was being sent to the browser by an echo or something, but I couldn't find any echo statements.

I don't know what could be causing this... If you want to see any code or HTML just ask.

Here's the HTML (only head and doctype) via the page source in Google Chrome

There seems to be some foreign characters in the source that I've never seen before, yet don't show up anywhere else (yahoo, or otherwise)

<!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条回答 默认 最新

  • douxian3828 2010-04-21 02:25
    关注

    Is your source possibly saved in "UTF8 BOM"? Wouldn't be the first time a leading BOM character is tripping up a parser. Try to save it as "UTF8 no-BOM" (may be called differently in your editor).

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 poi合并多个word成一个新word,原word中横版没了.
  • ¥15 【火车头采集器】搜狐娱乐这种列表页网址,怎么采集?
  • ¥15 求MCSCANX 帮助
  • ¥15 机器学习训练相关模型
  • ¥15 Todesk 远程写代码 anaconda jupyter python3
  • ¥15 我的R语言提示去除连锁不平衡时clump_data报错,图片以下所示,卡了好几天了,苦恼不知道如何解决,有人帮我看看怎么解决吗?
  • ¥20 关于URL获取的参数,无法执行二选一查询
  • ¥15 液位控制,当液位超过高限时常开触点59闭合,直到液位低于低限时,断开
  • ¥15 marlin编译错误,如何解决?
  • ¥15 VUE项目怎么运行,系统打不开