Odd Rendering Displacement, need solution

A week or so ago while working on my application, the output of all pages, contained in a base div element, for no apparant reason became displaced from the windows top border (specifically 1.5em), as if there was a margin there. For some time I kept working on other things but yesterday I thought it was about time to solve this odd situation, and I could use some input to debug it.

There is a reason I put it into the PHP section, though I am not completely sure it is PHP which causes it.

I have a number of page mockups from earlier on in the development using the very same CSS, and they are rendered as intended starting from the very top of the window, so it has nothing to do with CSS. Furthermore, this happens without CSS inclusions. I can superficially fix this by applying a negative top margin to the base div element (though it displaces the mockups), I would like to go to the bottom of this, especially since I do not want it to cause any unexpected issues in the future.

This morning I did some tests and found out that the first div element is always displaced in the php application context. And from tests I am doing while writing this, it appears the first div in every php file, at least in some cases, is rendered with a margin like displacement at the top.

Some time ago I converted all my files to utf-8 encoding, I do not know if it has something to do with that.

Edit: I wrote new files created in UTF-8 and this remained, the issue was solved by converting files to ‘UTF-8 without BOM’. I will leave the post in case someone else happens to search for the same issue.

After converting all files to UTF-8 without BOM (admittedly for ambiguous reasons), this was not solved after all. Thus, any feedback is welcome.

I am afraid it has to do with the encoding convertions, are there any risks with that which one should know about?

I will try creating new files and see what happens.