如题,index.php没有require global.php之前,box层是在网页顶部居中,可是require global.php之后,box层顶部出现不部分空白,并且左对齐了,body的margin:0;和box的margin:0 auto;效果都消失了global.php代码如下:
require("web_config.php");
header("Content-Type: text/html; charset=" . LZ_WEB_CHARSET);
require_once(dirname(__FILE__) . "/" . "./function.inc.php");
require_once(dirname(__FILE__) . "/" . "./mysql_config.php");
require_once(dirname(__FILE__) . "/" . "./mysql_class.php");
$db = new MYSQL_DB;index.php代码如下:<?php
require_once(dirname(__FILE__) . "/" . "./global.php");
?>
<!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">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<style type="text/css">
<!--
body,td,th {
font-size: 12px;
}
body {
margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
}
form {
margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
}
.box {
width: 900px;
height: 300px;
background: #369369;
margin: 0 auto;
overflow: hidden;
}
-->
</style></head><body>
<div class="box">
</div>
</body>
</html>