dshkmamau65777662 2014-08-07 04:52
浏览 48

Chrome / Opera中标题分页上方的差距

I have a gap appearing above the header of my page in Chrome and Opera which is breaking the navigation and other parts of the page. Please see here.

I had this exact same problem before rebuilding my site but can't for the life of me remember now what the problem was or what I did to fix it... hopefully it is not something too stupidly simple and obvious, and allow me to apologize in advance if it is, but I'm feeling a bit too mentally drained to even think straight enough to figure it out at the moment, despite my best efforts.

I suspect it may be somehow related to the simple PHP script which randomly loads either index1.html or index2.html from the root directory, since if you go to either URL directly (ie. http://samnorris.co.nz/tesla/index2.html) the problem is no longer apparent... I'm not sure if some kind of invisible error is being spit out or something which is breaking the page?

This is the PHP script which is contained in an index.php in the root dir

<?php
$randNumber = mt_rand(1,3);
if ( $randNumber == 1 )
{
    include 'index1.html';
}
else
{
    include 'index2.html';
}
?>

I have checked the Web Inspector tools in Chrome but am not overly familiar enough to know how to interpret it properly, there seems to be one small error relating to part of a script in siriwave.js - but I don't think it is related...

I'm at a bit of a loss, so any help at all would be appreciated!

  • 写回答

3条回答 默认 最新

  • dongyuntao2000 2014-08-07 05:18
    关注

    Okay, definitely solved it this time. Seems this was the issue: http://wordpress.org/support/topic/weird-characters-inserted-before-doctype

    something to do with incorrectly formatted UTF encoding in the php file... very weird indeed.

    评论

报告相同问题?