Gahh!!! Annoying Problem with IE7! Layout messing up.

Discussion in 'HTML & Website Design' started by emkay, Jul 13, 2008.

  1. #1
    Hi Guys, I would extremely appreciate if something can help me fix this. It happens in IE only and not Firefox.

    I am making an ebay listing design for one of my female clients. However there is a light problem with the main section aligning itself. Here is the full code:

    In Firefox, the layout looks like this, which is perfectly normal:
    http://www.imgsync.com/data/img/991184713-07-2008_17-54-35.jpg

    In IE however, the DIV with id "green_container" floats to the left when it's made perfectly clear that it should be in the centre.
    http://www.imgsync.com/data/img/106391813-07-2008_17-55-10.jpg

    Can anyone suggest what I am doing wrong? I would absolutely adore any potentially conclusive assistance!

    Here is the full code:

    <!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>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Grey</title>
    <style type="text/css">
    <!--
    .img {
    	border: 5px #eeeddc solid;
    	margin-right:15px;
    	float:left;	
    }
    #green_outer {
    	margin:auto;
    	background-color:#ecebdf;
    	width:100%;
    	background-image:url(http://simplisticstyle.com/clients/tessas/grey/images/topgreen.png);
    	background-position:top;
    	background-repeat:no-repeat;
    	padding-top:140px;
    	overflow:hidden;
    	padding-bottom:50px;
    }
    #green_container {
    	width:899px;
    	margin:auto;
    }
    #green_title {
    	padding-left:250px;
    	font-family:Arial, Helvetica, sans-serif;
    	font-size:18px;
    	font-weight:800;
    	color:#FFFFFF;
    }
    #green_cont2 {
    	margin-top:25px;
    	background-color:#FFFFFF;
    	margin-left:2px;
    	padding:10px;
    	font-family:Arial, Helvetica, sans-serif;
    	font-size:14px;
    	color:#9b9a8c;
    	line-height:165%;
    	overflow:hidden;
    }
    body {
    	margin-left: 00px;
    	margin-top: 00px;
    	margin-right: 00px;
    	margin-bottom: 00px;
    }
    -->
    </style>
    </head>
    
    <body>
    <div id="green_outer">
      <div id="green_container">
    	  <div id="green_title">Listing Title Goes Over Here</div>
        <div id="green_cont2">
          <div><div style="float:left;"><img src="http://simplisticstyle.com/clients/tessas/grey/images/photo.png" alt="photo" width="452" height="327" class="img" />
    <div style="padding-top:10px; padding-bottom:10px; clear:both;"><img src="http://simplisticstyle.com/clients/tessas/grey/images/thumb1.gif" width="78" height="64" class="img" />      <img src="http://simplisticstyle.com/clients/tessas/grey/images/thumb1.gif" alt="" width="78" height="64" class="img" /><img src="http://simplisticstyle.com/clients/tessas/grey/images/thumb1.gif" alt="" width="78" height="64" class="img" /><img src="http://simplisticstyle.com/clients/tessas/grey/images/thumb1.gif" alt="" width="78" height="64" class="img" /></div>
    </div><img src="http://simplisticstyle.com/clients/tessas/grey/images/desc.gif" alt="Description" width="204" height="35" /><br />
          <p><strong>Lorem Ipsum</strong> is simply dummy text of the printing and  typesetting industry. Lorem Ipsum has been the industry's standard  dummy text ever since the 1500s, when an unknown printer took a galley  of type and scrambled it to make a type specimen book. It has survived  not only five centuries, but also the leap into electronic typesetting,  remaining essentially unchanged. It was popularised in the 1960s with  the release of Letraset sheets containing Lorem Ipsum passages, and  more recently with desktop publishing software like Aldus PageMaker  including versions of Lorem Ipsum.<br />
          </p>
            <p> It was popularised in the 1960s with  the release of Letraset sheets containing Lorem Ipsum passages, and  more recently with desktop publishing software like Aldus PageMaker  including versions of Lorem Ipsum.</p>
          </div>
          <div style="padding-top:10px; clear:both; background-image:url(http://simplisticstyle.com/clients/tessas/grey/images/shadow.gif); background-repeat:repeat-x;">
            <p><img src="http://simplisticstyle.com/clients/tessas/grey/images/shipping.gif" alt="shipping" width="360" height="35" /><br />
              <br />
    It is a long established fact that a reader will be distracted by the  readable content of a page when looking at its layout. The point of  using Lorem Ipsum is that it has a more-or-less normal distribution of  letters, as opposed to using 'Content here, content here', making it  look like readable English. Many desktop publishing packages and web  page editors now use Lorem Ipsum as their default model text, and a  search for 'lorem ipsum' will uncover many web sites still in their  infancy. Various versions have evolved over the years, sometimes by  accident, sometimes on purpose (injected humour and the like).</p>
            <p><img src="http://simplisticstyle.com/clients/tessas/grey/images/payments.gif" alt="Payments" width="313" height="35" /></p>
            <p> Many desktop publishing packages and web  page editors now use Lorem Ipsum as their default model text, and a  search for 'lorem ipsum' will uncover many web sites still in their  infancy. Various versions have evolved over the years, sometimes by  accident, sometimes on purpose (injected humour and the like).</p>
            <p><img src="http://simplisticstyle.com/clients/tessas/grey/images/returns.gif" alt="Returns" width="263" height="35" /></p>
            <p>It was popularised in the 1960s with  the release of Letraset sheets containing Lorem Ipsum passages, and  more recently with desktop publishing software like Aldus PageMaker  including versions of Lorem Ipsum.</p>
            <p><img src="http://simplisticstyle.com/clients/tessas/grey/images/contact.gif" alt="Contact" width="263" height="35" /></p>
          </div>
        </div>
      </div>
    </div>
    </body>
    </html>
    HTML:
    HTML PREVIEW: http://www.simplisticstyle.com/help/preview.htm
     
    emkay, Jul 13, 2008 IP
  2. knukk

    knukk Peon

    Messages:
    43
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #2
    The code you gave me centers it properly when I try it in IE7 here. :p
     
    knukk, Jul 13, 2008 IP
  3. rebelagent

    rebelagent Well-Known Member

    Messages:
    876
    Likes Received:
    46
    Best Answers:
    0
    Trophy Points:
    165
    #3
    Looks like you need to specify width for that div.

    Internet will read it literally and float the box to the furthest end of the table/div width without wrapping text.

    Set a width.
     
    rebelagent, Jul 13, 2008 IP
  4. emkay

    emkay Guest

    Messages:
    351
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Which DIV do you mean?
    Nevermind guys, I found temporary fix. Will be using a table to centre instead until I find the complete fix.
     
    emkay, Jul 13, 2008 IP
  5. rebelagent

    rebelagent Well-Known Member

    Messages:
    876
    Likes Received:
    46
    Best Answers:
    0
    Trophy Points:
    165
    #5
    Even though you decided on tables it was the div containing and controlling this portion.

    <img src="http://simplisticstyle.com/clients/tessas/grey/images/desc.gif" alt="Description" width="204" height="35" /><br />
    <p><strong>Lorem Ipsum</strong> is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.<br />
    </p>
     
    rebelagent, Jul 13, 2008 IP