?
Solved

CSS layout different in IE and FireFox/Safari

Posted on 2009-05-18
3
Medium Priority
?
1,087 Views
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" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>Untitled Page</title>
 
       <style type="text/css">
        *
        {
            font-family: Verdana, Arial, Sans-Serif;
        }
        body
        {
            margin: 0;
            background-repeat: no-repeat;
            background-color: #464646;
            color: White;
            height: 100%;
        }
        #PageWrapper
        {
            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. */
        }
        #Header
        {
            height: 120px;
            margin: auto;
            border-bottom: 2px solid gray;
        }
        .headerText
        {
            float: right;
            padding-right: 20px;
            text-align: right;
            font-size: 18px;
            width: 700px;
            margin-top: 45px;
        }
        #MenuWrapper
        {
            width: 180px;
            position: relative;
            float: left;
            padding-top: 20px;
            padding: 10px;
            color: #a0a0a0;
            background-color: #ff0000;
        }
        .menuText
        {
            display: block;
            font-size: small;
        }
        #MainContent
        {
            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;
        }
        #Buttons
        {
            width: 720px;
            position: relative;
            margin-left: 180px;
            padding-left: 30px;
            border-left: 2px solid Gray;
            height: 40px;
            font-size: 0.8em;
        }
        #Footer
        {
            text-align: center;
            border-top: 2px solid Gray;
            font-size: small;
            color: Gray;
            height: 37px;
            clear: both;
        }
    </style>
</head>
<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>
        </div>
        <div id="MenuWrapper">
        </div>
        <div id="MainContent">
            This is the content
            <input type="hidden" name="ctl00$cpMainContent$hidChrome" id="ctl00_cpMainContent_hidChrome" />
        </div>
        <div id="Buttons">
            <table width="100%" border="0">
                <tr>
                    <td width="50%">
                        <input type="submit" name="ctl00$cmdBack" value="Back" id="ctl00_cmdBack" />
                    </td>
                    <td align="right">
                        <input type="submit" name="ctl00$cmdNext" value="Next" id="ctl00_cmdNext" />
                    </td>
                </tr>
            </table>
        </div>
        <div id="Footer">
            &copy; <a id="ctl00_lnkOrganisation">Organisation</a> &nbsp;and
            <a href="http://www.photocompsoftware.com" target="_blank">PhotoCompSoftware</a>
        </div>
    </div>
    </form>
</body>
</html>

Open in new window

0
Comment
Question by:PhotoCompManager
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 3

Accepted Solution

by:
bleech677 earned 1000 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
0
 
LVL 3

Expert Comment

by:bleech677
ID: 24412229
Safari and chrome look good as well
0
 

Author Closing Comment

by:PhotoCompManager
ID: 31582585
Many thanks
0

Featured Post

Will your db performance match your db growth?

In Percona’s white paper “Performance at Scale: Keeping Your Database on Its Toes,” we take a high-level approach to what you need to think about when planning for database scalability.

Question has a verified solution.

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

When it comes to security, close monitoring is a must. According to WhiteHat Security annual report, a substantial number of all web applications are vulnerable always. Monitis offers a new product - fully-featured Website security monitoring and pr…
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).
Suggested Courses

801 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