我在 php 中遇到 require 或 include 函数的样式问题。每当我包含一个 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">
<?php
include('database.php');
include('login.php');
?>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Web Design - Free CSS Templates</title>
<meta name="keywords" content="free css templates, web design, 2-column, html css" />
<meta name="description" content="Web Design is a 2-column website template (HTML/CSS) provided by templatemo.com" />
<link href="templatemo_style.css" rel="stylesheet" type="text/css" />
<!--////// CHOOSE ONE OF THE 3 PIROBOX STYLES \\\\\\\-->
<link href="css_pirobox/white/style.css" media="screen" title="shadow" rel="stylesheet" type="text/css" />
<!--<link href="css_pirobox/white/style.css" media="screen" title="white" rel="stylesheet" type="text/css" />
<link href="css_pirobox/black/style.css" media="screen" title="black" rel="stylesheet" type="text/css" />-->
<!--////// END \\\\\\\-->
</head>
<body>
<div id="templatemo_body_wrapper">
<div id="templatemo_wrapper">
<div id="tempaltemo_header">
<span id="header_icon"></span>
<div id="header_content">
<div id="site_title">
<a href="http://www.templatemo.com" target="_parent"><img src="images/templatemo_logo.png" alt="LOGO" /></a> </div>
<p>This is a free CSS website layout from templatemo.com website. Feel free to edit and apply for your websites. Duis vitae velit sed dui malesuad mollis aliquet ligula.</p>
<a href="#" class="detail float_r">Detail</a>
</div>
</div> <!-- end of header -->
浏览器看到的模板源代码:http ://www.text-upload.com/read,4081536104820
我编辑的代码(除了包含部分没有编辑):http ://www.text-upload.com/read,4081542128884