Link to home
Start Free TrialLog in
Avatar of LisaWilcox
LisaWilcoxFlag for United States of America

asked on

Help with Left sidebar div noting floating with content div

I've got this site www.webgirlwebdesigns.com/testing/TriBeam and the left side bar doesn't come all the way down or float with the content. Below is the css for the sidebar. Can anyone offer some advice on why this isn't happening?
Thanks
Lisa

/* Content > Main */

#main {
      float: left;
      width: auto;
      margin-left: 10px;
}

#main a {
}

/* Content > Main > Welcome */

#welcome {
      width: 750px;
      padding-left: 10px;
      padding-right: 10px;
}

/* Content > Main > Example */
#content{ padding-left: 18px; }

/* Content > Sidebar */

#sidebar {
      float: left;
      width: 180px;
      background-color: #E7F5FE;
      height: 640px;
      padding-left: 5px;
      padding-right: 5px;
      border-left: 1px solid #75B4D4;
      border-right: 1px solid #75B4D4;
      border-top: 1px solid #75B4D4;
}

#sidebar a {
}
#inputsubmit1   {
      padding: 10px 0;
}
Avatar of dolcezzza
dolcezzza

Looks fine in mac firefox and Safari.
A browser-specific issue maybe?
Avatar of LisaWilcox

ASKER

In WIndows XP and Vista in Firefox and IE, the left side bar doesn't float down with the content.
If someone has some browser specific hacks it would be appreciated.
Avatar of boro_bob
Its simply because you have fixed widths for the sidebar and main content. When the browser window is less than about 100px, there isn't room for them side by side, so the main content is pushed below the sidebar. When the browser window is wider than 1000px the layout looks fine.

I suggest nesting the sidebar and main divs in a wrapper, and fixing the width of the wrapper at a size large enough to accomodate them side by side. Then if a browser window is smaller than that, you'll get a horizontal scrollbar and the content will stay in place.
I already have wrapper elements in my css

#wrapper:after
      {
      content: '[DO NOT LEAVE IT IS NOT REAL]';
      display: block;
      height: 0;
      clear: both;
      visibility: hidden;
      }
#wrapper
      {
      display: inline-block;
      }
/*\*/
#wrapper
      {
      display: block;
      }


But that css is not doing anything on your page because you do not have a div with an id="wrapper". Which makes me wonder where you got that css from and what you think its doing?

Anyway, you need something like this in your html:
<div id="menu">
   <!--Menu html here-->
</div>
<div id=wrapper">
   <div id="sidebar">
      <div class="content">
         <!--Content html here-->
      </div>
   </div>
   <div id="main">
       <!--Main content html here-->
   </div>
</div>
 
<!-- and in you css -->
#wrapper
{
   width: 995px; /* Or whatever width you need
   margin: 0;
   padding: 0; 
}

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of LisaWilcox
LisaWilcox
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial