I've written a simple php include today and place the header information in it..
header.inc.php
<div>some text in header bar</div>
index.php
<html>
...
<body>
<?php include_once('/include/header/header.inc.php'); ?>
....
When I ran the page and found that there are empty spaces at the top of my header text.. Checked with different version of browser, the spaces could only be found in firefox and chrome, whereas IE shows perfectly in the screen.
Inspect the element in chrome, there are some white space added at the top of the page..
Solution
The problem was caused by the BOM header in the php file and could be solved by changing the encoding to "Encode in UTF-8 without BOM"

沒有留言:
張貼留言