Since I’m a beginner and needed to get a relative’s site up quick, I purchased a pre-made template. I originally had everything in plain HTML and all the pages showed just fine in Chrome, FF, IE and Safari. Thinking that the pages will grow and it’d be good to put the header, navigation and footer in include files, I did that without much trouble and everything was going well while testing in Chrome, FF and Safari. IE (I’m using IE9) is a different story. All pages are pushed to the far left of the screen.
What confuses me is that I’ve changed NO code other than creating the includes and changing all the html pages over to php so it picks up the includes. If I remove the includes and put the header, navigation and footer back into a plain html page… it works perfectly again in IE.
In an effort to reduce the page size of this posting, I’ve linked to it via PasteBin. If this is a violation of any rules or frowned upon by this community, I apologize. Let me know and I’ll put it all here in this post.
I’ve already tried to change the margin in the CSS from ‘0’ to ‘auto’ (lines 3 & 12), and it didn’t do anything. Not that it should have, I was just trying anything.
If this question has already been answered for my specific situation, I apologize and if someone could point me in the direction of the previous answers, that would be great. I searched, but didn’t see anyone that had the same situation where it worked fine in html but broke when put in php includes.
Any help would be appreciated.
Your DOCTYPE has gotten messed up. The first output line of your header (or wherever your opening
<html>is) should beThe DOCTYPE declaration must be the first line of your output before the HTML tag, or IE reverts to Quirks mode (IE 5.5 compatibility mode).