【发布时间】:2011-12-01 05:34:19
【问题描述】:
在我正在开发的网络应用程序中,在 Chrome 和 Firefox 之间进行测试时,我发现元素在 DOM 中的位置有所不同。
在 Chrome 中查看页面时,<head> 标记中的元素似乎被放置在 <body> 中,还有一些空格。在 FireFox 中查看该站点时不会出现此问题。
什么会导致这样的元素错位? http://archives.wsusignpost.com
我在 PHP 中生成页面,从 MySql 数据库中提取数据。
db.php包含在header.php中,而header.php包含在index.php中
header.php:
<?php require('db.php'); ?>
<!DOCTYPE html>
<html>
<head>
<title>The Signpost: Archives</title>
<meta name="keywords" content="..." />
<meta name="title" content="..." />
<meta name="description" content="..." />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link href="style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="container">
<a href="http://www.wsusignpost.com">
Main Signpost Website
</a>
<h1>
<img id="banner" src="..." \>
</h1>
【问题讨论】:
-
可能与开发工具有关,因为如果您查看源代码(我的意思是 Ctrl+U),代码是正确的(抱歉之前的评论,我搞混了哈哈)
-
是的,源代码在视图源中看起来确实正确。好奇渲染还是不一样。
标签: php firefox dom google-chrome