While building a WordPress theme, I found a blank line at the very top of the page that no CSS could remove. The source looked fine. Using Chrome’s console (right-click “Inspect Element” in Chrome, like Firefox’s Firebug), I discovered that meta, link, script and other head elements had all fallen into the body, and there were two blank lines under the body, wrapped in quotes. See the image:
After searching online for a while I found the cause: I had edited the homepage’s PHP file with Notepad. Here’s what happened: opening the original file in UltraEdit in hex mode showed three extra bytes, “EF BB BF”, at the start; editors like Dreamweaver or Notepad++ don’t add those three bytes. EF BB BF is the UTF-8 byte-order mark Microsoft adds at the start of text files. I had edited the PHP file with Windows Notepad, so it got the EF BB BF added, but PHP clearly doesn’t support Microsoft’s “original” design, and things broke. So fellow programmers, use a proper editor — Notepad isn’t almighty.

