Hi! Forgive me, I am a relative CSS newbie. I have a div that is floated to the right with another div (main info) I'd like to wrap around the div column to the right. It looks fine in Safari/Firefox on the Mac, but it doesn't work for IE (v. 7) on the PC. All the info I want to wrap around the left column just moves to the bottom of the column and leave a huge white gap to the left of the column. I'm attaching a screenshot from Safari...this is how I want it to look...[attachment=0]Picture 3.png[/attachment]except for the margin issue to the left which brings me to another issue. How do I fix that margin issue? I've been screwing around with this for a couple days and now I feel I have messed up a few things. Here's the html and css:
<!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>Gregory Court Reporting | About</title> <link href=\"twoColFixLtHdr.css\" rel=\"stylesheet\" type=\"text/css\" /> <!--[if IE 5]> <style type=\"text/css\"> /* place css box model fixes for IE 5* in this conditional comment */ .twoColFixLtHdr #sidebar1 { width: 230px; } </style> <![endif]--><!--[if IE]> <style type=\"text/css\"> /* place css fixes for all versions of IE in this conditional comment */ .twoColFixLtHdr #sidebar1 { padding-top: 30px; } .twoColFixLtHdr #mainContent { zoom: 1; } /* the above proprietary zoom property gives IE the hasLayout it needs to avoid several bugs */ </style> <![endif]--> <link href=\"gcr_styles.css\" rel=\"stylesheet\" type=\"text/css\" /> <script src=\"SpryAssets/SpryMenuBar.js\" type=\"text/javascript\"></script> <link href=\"SpryAssets/SpryMenuBarHorizontal.css\" rel=\"stylesheet\" type=\"text/css\" /> <style type=\"text/css\"> <!-- .style6 { color: #666666; line-height: 0.9em; } --> </style> </head>
<body class=\"twoColFixLtHdr\">
<div id=\"container\"> <div id=\"header\"> <!-- end #header -->
<div class=\"mybuggyelement\" id=\"mainContentwrap\"> <div id=\"sidebar1\"> <p align=\"center\" class=\"style6\"><br /> <strong><br /> <br /> <br /> <br /> CONFERENCE ROOMS</strong><br /> <br /> <span class=\"boldbulletheading\">LEGAL PROCEEDINGS</span><br /> <span class=\"bodycenter\">Depositions • Trials<br /> Arbitrations • Hearings<br /> Examinations<br /> Sworn Statements<br /> Private Conferences</span><br /> <span class=\"boldbulletheading\"><br /> </span><span class=\"boldbulletheading\">CORPORATE EVENTS</span><br /> <span class=\"bodycenter\">Meetings & Conferences<br /> Board Meetings • Conventions<br /> Corporate Annual Meetings<br /> </span><span class=\"boldbulletheading\"><br /> SERVICES AVAILABLE</span><br /> <span class=\"bodycenter\">Realtime Reporting<br /> Video & Audio Transcription<br /> Teleconference Facilities<br /> Interpreters & Translators<br /> Videotaping<br /> Wireless Internet<br /> Faxes & Photocopiers<br /> Video Editing/Conversions<br /> Synchronized Video/Text</span><br /> </p> <p align=\"center\" class=\"boldbulletheading\">EXPEDITED SERVICES <br /> AVAILABLE<br /> <br /> <br /> <br /> </p> </div> <p class=\"bodyother\"><img src=\"images/laura_headshot.jpg\" alt=\"\" name=\"\" width=\"157\" height=\"215\" class=\"fltrt\" />Laura Gregory founded Gregory Court Reporting in 1988 in Naples, Florida, following graduation from court reporting school, two years as a Deputy Official, and several years of freelance court reporting. She capably balanced raising a family with managing her business over many years with the help of dedicated staff and loyal clients.
<br /> </p> <p class=\"bodyother\"> Today, Gregory Court Reporting has grown to five conveniently located offices. It is now the largest, most respected, full service court reporting firm in Southwest Florida, serving Collier, Lee and Charlotte Counties, from Marco Island to Port Charlotte.
<br /> </p> <p class=\"bodyother\">Laura Gregory attributes the love and support of her family as paramount to her success in life and in business. Her three children are now grown and are attending college, preparing for their own careers.
<!-- end #container --></div> <script type=\"text/javascript\"> <!-- var MenuBar1 = new Spry.Widget.MenuBar(\"MenuBar1\", {imgDown:\"SpryAssets/SpryMenuBarDownHover.gif\", imgRight:\"SpryAssets/SpryMenuBarRightHover.gif\"}); //--> </script> </body> </html>
@charset \"UTF-8\"; body { font: 100% Verdana, Arial, Helvetica, sans-serif; background: #333333; 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; background-image: url(images/bcknd_800.jpg); background-repeat: repeat-y; background-position: 50% 0; } .twoColFixLtHdr #container { text-align: left; /* this overrides the text-align: center on the body element. */ max-width: 800px; margin-left: auto; margin-right: auto; width: 800px; } .twoColFixLtHdr #header { background: #ffffff; padding: 0; /* this padding matches the left alignment of the elements in the divs that appear beneath it. If an image is used in the #header instead of text, you may want to remove the padding. */ } .twoColFixLtHdr #header h1 { margin: 0; /* zeroing the margin of the last element in the #header div will avoid margin collapse - an unexplainable space between divs. If the div has a border around it, this is not necessary as that also avoids the margin collapse */ padding: 10px 0; /* using padding instead of margin will allow you to keep the element away from the edges of the div */ } .twoColFixLtHdr #sidebar1 { float: right; /* since this element is floated, a width must be given */ width: 227px; background-image: url(images/legalpad.jpg); background-repeat: no-repeat; padding-left: 10px; display: inline; } .twoColFixLtHdr #mainContent { margin: 0 250px 0 0; /* the left margin on this div element creates the column down the left side of the page - no matter how much content the sidebar1 div contains, the column space will remain. You can remove this margin if you want the #mainContent div's text to fill the #sidebar1 space when the content in #sidebar1 ends. */ padding: 0 0px 0 30px; /* remember that padding is the space inside the div box and margin is the space outside the div box */ z-index: 1; padding-top: 25px; }.twoColFixLtHdr #mainContentwrap { padding-top: 25px; margin-left: 10px; padding-left: 30px; float: left; width: 760px; } .twoColFixLtHdr #footer { padding: 0 10px 0 20px; /* this padding matches the left alignment of the elements in the divs that appear above it. */ background:#DDDDDD; } .twoColFixLtHdr #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 */ } .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: 23px; } .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; } .mybuggyelement { z-index: 1; }
in your main content div and sidebar div add:
overflow:hidden
please in future link to a working test page or use the code tags[ code] [ /code] NOTE: extra space used to show the tag
http://gregorycourtreporting.com.s62344.gridserver.com/
I think the home and "contact pages are displaying fine in IE. It's the rest of the pages I'm having the issue with.
Thanks!
Thanks for your help!
sorry but I was not going to look through all the code the way it was, I would have prefered to see the page and see it on firebug to work out.
but normally you should have:
container div
main content div /end it //overflow:hidden
sidebar div / end it //overflow:hidden
/ end container div