I.E. alignment issues

Discussion in 'CSS' started by grodt$, Jun 17, 2009.

  1. #1
    My main content is out of alignment in IE7 but looks fine in Safari and Firefox (big suprise there).



    http://fitnessworx.thehtmlcode.com/



    I can't get the page to align (shrink to fit) in IE like it does in Firefox or Safari.



    I used a template that states:



    <!--[if IE]>
    <style type="text/css">
    /* place css fixes for all versions of IE in this conditional comment */
    .twoColLiqLtHdr #sidebar1 { padding-top: 30px; }
    .twoColLiqLtHdr #mainContent { zoom: 1; padding-top: 15px; }
    /* the above proprietary zoom property gives IE the hasLayout it needs to avoid several bugs */
    </style>
    <![endif]-->



    I tried to use this but it didn't correct the issue.



    The areas that aren't aligning are:


    1) .twoColLiqLtHdr #header: The logo gets cut off when you maximize or "restore down" the browser.


    2) .twoColLiqLtHdr #sidebar2clm, This wants to stay in place but either my margin or padding settings here push the main content down when the page is "resotred down"


    3) .twoColLiqLtHdr #mainContent2clm: The header is an image and it doesn't shrink down when I "restore down" the browser. ...and the entire image doesn't show in I.E.


    4) #menutop or #menutop a:link, #menutop a:visited or #menutop a:active, #menutop a:hover

    I put a "white space: no wrap" in #menutop li, #menutop ul; just to get the menu items to fit in I.E.

    I've tweaked my margins so much trying to fix this that I've made it worse. (I will start saving my original first)


    Here is my css file:


    body {
    font: 100% Verdana, Arial, Helvetica, sans-serif;
    background: #ffffff;
    margin: 0; /* it's good practice to zero the margin and padding of the body element to account for differing browser defaults */
    padding: 0;
    text-align: center; /* this centers the container in IE 5* browsers. The text is then set to the left aligned default in the #container selector */
    color: #000000;
    }
    .twoColLiqLtHdr #container {
    width: 60%; /* this will create a container 60% of the browser width */
    background: #FFFFFF;
    margin: 0 auto; /* the auto margins (in conjunction with a width) center the page */
    border: 1px solid #000000;
    text-align: left;
    }
    .twoColLiqLtHdr #header {
    background-repeat: no-repeat;
    height: 160px;
    background-position: left;
    background-image: url(../images/FitnessWorxLogo1.png);

    }
    /*Menu stuff*/

    #menutop {
    height: 23px;
    background-color: #000000;
    margin-right: 0px;
    margin-left: 0px;
    padding-top: 7px;
    padding-right: 10px;
    }

    #menutop li, #menutop ul {
    display: inline;
    text-align: left;
    word-spacing: 1px;
    white-space: nowrap;
    margin-left: 1px;
    padding-left: 0px;
    padding-top: 0px;
    padding-right: 0px;
    padding-bottom: 0px;
    }

    #menutop a:link, #menutop a:visited {
    color: #FFFFFF;
    text-decoration: none;
    border-top-width: thin;
    border-right-width: thin;
    border-left-width: thin;
    border-top-style: inset;
    border-right-style: inset;
    border-left-style: inset;
    border-top-color: #FFFFFF;
    border-right-color: #FFFFFF;
    border-left-color: #FFFFFF;
    font-family: Verdana, Arial, Helvetica, sans-serif;
    font-size: 13px;
    font-weight: bolder;
    padding: 5px;
    background-color: #272727;
    margin-top: 1px;
    }

    #menutop a:active, #menutop a:hover {
    color: #000000;
    text-decoration: none;
    background-color: #FFFFFF;
    }
    .twoColLiqLtHdr #header h1 {
    margin: 0;
    }

    /* Tips for sidebar1:
    1. since we are working in percentages, it's best not to use padding on the sidebar. It will be added to the width for standards compliant browsers creating an unknown actual width.
    2. Space between the side of the div and the elements within it can be created by placing a left and right margin on those elements as seen in the ".twoColLiqLtHdr #sidebar1 p" rule.
    3. Since Explorer calculates widths after the parent element is rendered, you may occasionally run into unexplained bugs with percentage-based columns. If you need more predictable results, you may choose to change to pixel sized columns.
    */
    .twoColLiqLtHdr #sidebar2clm {
    float: right;
    width: 24%;
    height: 600px;
    padding-top: 10px;
    padding-right: 5;
    padding-bottom: 10px;
    padding-left: 5;
    margin-left: 10px;
    margin-right: 11px;
    margin-top: 10px;
    margin-bottom: 10px;
    }

    .twoColLiqLtHdr #sidebar1clm {
    float: left;
    width: 24%; /* the background color will be displayed for the length of the content in the column, but no further */
    padding: 15px 0; /* top and bottom padding create visual space within this div */
    background-color: #FFFFFF;
    }
    .twoColLiqLtHdr #sidebar2clm h3, .twoColLiqLtHdr #sidebar2clm p {
    margin-left: 10px; /* the left and right margin should be given to every element that will be placed in the side columns */
    margin-right: 10px;
    }
    .twoColLiqLtHdr /* Tips for mainContent:
    1. the space between the mainContent and sidebar1 is created with the left margin on the mainContent div. No matter how much content the sidebar1 div contains, the column space will remain. You can remove this left margin if you want the #mainContent div's text to fill the #sidebar1 space when the content in #sidebar1 ends.
    2. to avoid float drop at a supported minimum 800 x 600 resolution, elements within the mainContent div should be 430px or smaller (this includes images).
    3. in the Internet Explorer Conditional Comment below, the zoom property is used to give the mainContent "hasLayout." This avoids several IE-specific bugs.
    */
    #mainContent2clm {
    margin-top: 15;
    margin-right: 10px;
    margin-bottom: 15px;
    margin-left: 1%;
    width: 70%;
    border-right-width: thin;
    border-right-style: inset;
    border-right-color: #000000;
    padding-top: 10px;
    padding-right: 7px;
    padding-bottom: 10px;
    padding-left: 10px;
    }
    .twoColLiqLtHdr #container #mainContent2clm h1 {
    font-weight: lighter;
    }

    #mainContent1clm {
    margin: 0 20px 0 3%;

    }

    /* brand page */

    #mainContentbrandclm {
    margin: 0 20px 0 3%;

    }

    #brandtable {
    background-color: #FFFFFF;
    width: 70%;
    border: 0;
    padding: 2, 5, 2, 5;
    text-align: center;
    margin: 4;

    }
    .twoColLiqLtHdr #footer {
    padding: 0 10px;
    background-color: #000000;
    }
    .twoColLiqLtHdr #footer p {
    margin: 0; /* zeroing the margins of the first element in the footer will avoid the possibility of margin collapse - a space between divs */
    padding: 10px 0; /* padding on this element will create space, just as the the margin would have, without the margin collapse issue */
    font-family: Georgia, "Times New Roman", Times, serif;
    color: #feda02;
    text-align: center;
    }

    /* Miscellaneous classes for reuse */
    .fltrt { /* this class can be used to float an element right in your page. The floated element must precede the element it should be next to on the page. */
    float: right;
    margin-left: 8px;
    }
    .fltlft { /* this class can be used to float an element left in your page */
    float: left;
    margin-right: 8px;
    }
    .clearfloat { /* this class should be placed on a div or break element and should be the final element before the close of a container that should fully contain a float */
    clear:both;
    height:0;
    font-size: 1px;
    line-height: 0px;
    }
    .CIform {
    width: 60px;
    }
    #Contacttable {
    font-family: Georgia, "Times New Roman", Times, serif;
    font-size: 24px;
    font-style: normal;
    line-height: normal;
    text-align: left;
    margin: 6px;
    padding-top: 5px;
    padding-right: 5px;
    padding-bottom: 5px;
    }
    #CIform p {
    font-family: Georgia, "Times New Roman", Times, serif;
    font-size: 12px;
    color: #333333;
    }




    Thank you,

    Will
     
    grodt$, Jun 17, 2009 IP