0

I've created a page using Bootstrap and everything looks ok while it is in HTML form but when I convert them to php, an extra vertical space appears under one of the divs.

I have 3 files here.

header.php
index.php
footer.php

The vertical space appears after the last DIV in the index.php before footer starts. It is very odd because this is not happening in HTML form, so this has to do something with PHP right?

<?php
    $url_path        = "../";
    include ($url_path . "header.php");
?>   
<div class="wrap">   
</div>
<?php
    include ($url_path . "footer.php");
?>

You can see where the white-space appears in these images.

After the div class="wrap" tag

FireBug:

enter image description here

Chrome:

enter image description here

The odd thing is that when I remove

<?php
    include ($url_path . "footer.php");
?>

and copy and paste the whole content of the footer.php there everything looks fine again.

Vahid
  • 5,144
  • 13
  • 70
  • 146
  • does the space get added to the rendered page or just the source? – Pete Sep 19 '14 at 09:45
  • It gets added to the rendered page and the inspector displays it too, but when I click on view page source, the space is not there! – Vahid Sep 19 '14 at 09:48
  • Do you have any styles on the div or something? – Florin Pop Sep 19 '14 at 09:54
  • Are there some special hidden characters that your editor isn't picking up - try copying and pasting into notepad and then back into your footer.php and see if that works - in your firebug there seems to be an `` - [this post may help](http://stackoverflow.com/questions/9691771/why-is-65279-appearing-in-my-html) – Pete Sep 19 '14 at 09:59
  • @Flopet17 No, just `overflow = hidden`, and it is not because of that, when I replace the footer include part with the actual contents of the footer.php everything looks fine, I don't know what happens when I use include. – Vahid Sep 19 '14 at 10:00
  • @Pete I did that too, This is the oddest thing ever happened to me while designing web pages! – Vahid Sep 19 '14 at 10:02

0 Answers0