CSS layout different in IE and FireFox/Safari

Posted on 2009-05-18
Last Modified: 2013-11-19
The layout of my page is different when rendered by IE and when rendered by FireFox/Safari
In the sample, you will see the red box (the "MenuWrapper" div) overruns in FireFox but the "Buttons" div is aligned, while in IE it's the other way round.

Please can you suggest code that works in both browsers. (the red box should fit in the left column and the buttons should be at the bottom of the main content and the whole page should centre horizontally in the user's browser).
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">

<html xmlns="">


    <title>Untitled Page</title>

       <style type="text/css">



            font-family: Verdana, Arial, Sans-Serif;




            margin: 0;

            background-repeat: no-repeat;

            background-color: #464646;

            color: White;

            height: 100%;




            width: 980px;

            background: black;

            margin: 0 auto; /* the auto margins (in conjunction with a width) center the page */

            text-align: left; /* this overrides the text-align: center on the body element. */




            height: 120px;

            margin: auto;

            border-bottom: 2px solid gray;




            float: right;

            padding-right: 20px;

            text-align: right;

            font-size: 18px;

            width: 700px;

            margin-top: 45px;




            width: 180px;

            position: relative;

            float: left;

            padding-top: 20px;

            padding: 10px;

            color: #a0a0a0;

            background-color: #ff0000;




            display: block;

            font-size: small;




            width: 720px; /* 980- menuwrapper width - a margin*/

            position: relative;

            margin-left: 180px;

            min-height: 250px;

            padding: 10px;

            padding-top: 20px;

            border-left: 2px solid Gray;

            font-size: 0.8em;




            width: 720px;

            position: relative;

            margin-left: 180px;

            padding-left: 30px;

            border-left: 2px solid Gray;

            height: 40px;

            font-size: 0.8em;




            text-align: center;

            border-top: 2px solid Gray;

            font-size: small;

            color: Gray;

            height: 37px;

            clear: both;




<body onload="sizeWindowToContent()">

    <form name="aspnetForm" method="post" action="Default.aspx" id="aspnetForm">

    <input type="hidden" name="ctl00$hidChrome" id="ctl00_hidChrome" />

    <div id="PageWrapper">

        <div id="Header">

            <div class="headerText">

                <span id="ctl00_lblTitle">Title</span>



        <div id="MenuWrapper">


        <div id="MainContent">

            This is the content

            <input type="hidden" name="ctl00$cpMainContent$hidChrome" id="ctl00_cpMainContent_hidChrome" />


        <div id="Buttons">

            <table width="100%" border="0">


                    <td width="50%">

                        <input type="submit" name="ctl00$cmdBack" value="Back" id="ctl00_cmdBack" />


                    <td align="right">

                        <input type="submit" name="ctl00$cmdNext" value="Next" id="ctl00_cmdNext" />





        <div id="Footer">

            &copy; <a id="ctl00_lnkOrganisation">Organisation</a> &nbsp;and

            <a href="" target="_blank">PhotoCompSoftware</a>






Open in new window

Question by:PhotoCompManager
  • 2

Accepted Solution

bleech677 earned 250 total points
ID: 24412217
set your menuwrapper to 160px

you have an extra padding in maincontent?

           padding: 10px;
            padding-top: 20px;

Those changes look good in ff3 and IE8 for me - unfortunalty I don't have IE7 anymore to test

Expert Comment

ID: 24412229
Safari and chrome look good as well

Author Closing Comment

ID: 31582585
Many thanks

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Learn by example how to specify CSS selectors for Selenium WebDriver test automation software.
Find out what you should include to make the best professional email signature for your organization.
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…

914 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now