• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 769
  • Last Modified:

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;
}
0
LisaWilcox
Asked:
LisaWilcox
  • 3
  • 2
1 Solution
 
dolcezzzaCommented:
Looks fine in mac firefox and Safari.
A browser-specific issue maybe?
0
 
LisaWilcoxAuthor Commented:
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.
0
 
boro_bobCommented:
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.
0
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
LisaWilcoxAuthor Commented:
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;
      }


0
 
boro_bobCommented:
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

0
 
LisaWilcoxAuthor Commented:
ve been reading http://www.alistapart.com/articles/holygrail  and trying to follow instructions. Now it seems I have too much sidebar carrying down..Im so beyond frustrated, please advise
The site link is as follows:
http://www.webgirlwebdesigns.com/testing/TriBeam/index.html

In my sidebar css, I have the following:
#sidebar {
      width: 180px;
      background-color: #E7F5FE;
      padding-left: 5px;
      padding-right: 5px;
      border-left: 1px solid #75B4D4;
      border-right: 1px solid #75B4D4;
      border-top: 1px solid #75B4D4;
      position: absolute;
      top: 87px;
      overflow: hidden;
      padding-bottom: 400em;     /* X + padding-bottom */
      margin-bottom: -400em;     /* X */
      height: 23px;
}

Ive tried adjusting the em variables and cant make it work.
Any help would be appreciated.
Thanks
0

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now