In IE: my CSS has been changed while using a mysql based SESSION with php

Problem

This has been stumping me all day. I'm using a mysql based SESSION on my php file. All of the other browsers, except IE, are displaying my pages with the appropriate CSS files and they look fine (more specifically, it is changing my hover effects on my menu and changing the alignment of my footer). I've tested the file without the SESSION code in IE and it works fine. What is causing IE to change my layout when the SESSION is added?? Very frustrated. I'm sure you can tell I'm a php beginner from this message. Please help. Thank you. James

  <?php
 session_start();
 if(@$_SESSION['auth'] != yes)
 {
  header("location: http://www.setdesign-la.com/login_reg.php");
  exit();
 }
echo "<center><a href='logOut.php'>Log Out</a></center>\n";
 ?> 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-GB"> 
<head> 
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 

Bagelmania | bagels and spreads | delicious coffee | sandwiches

<link rel="shortcut icon" href="bm.ico"> 
<link rel="stylesheet" type="text/css" href="http://www.setdesign-la.com/bagelmaniaStyle.css"/>
<link rel="stylesheet" type="text/css" href="http://www.setdesign-la.com/bagelmaniaMainMenu.css"/>
<link rel="stylesheet" type="text/css" href="http://www.setdesign-la.com/bagelmaniaFooter.css"/>




</head>


<body>
 <div id="topFade"></div>
  <div id="banner">
  <div id="bannerContainer"> 
   <div id="bannerContent">
<div id="bannerFlower"> 
             </div> 
             <!-- END BannerFlower --> 
    <div id="bannerPar">
    </div> <!-- END bannerPar -->


  </div><!-- END bannerContent -->
 </div><!-- END bannerContainer -->
</div><!-- END banner -->

<div id="menuWrapper"> 
<div id="menuContainer"> 
  <div id="centeredmenu"> 

       -Home
       -Affiliate Marketing
       -SEO 

   -Training  
   -Articles 
                 -Tacos
       -Yum 

  </div>   <!-- END centeredmenu --> 
 </div>   <!-- END menuContainer --> 

</div>  <!-- END menuWrapper --> 


<div id="wrapper">
  <div id="container">
Problem courtesy of: James30

Solution

The reason is probably that you are outputting HTML before you are declaring the doctype. That causes IE to switch to quirks mode.

Solution: Move this line

echo "<center><a href='logOut.php'>Log Out</a></center>\n";

into the HTML document.

Solution courtesy of: Pekka 웃

Discussion

There is currently no discussion for this recipe.

This recipe can be found in it's original form on Stack Over Flow.