473,473 Members | 1,823 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

How to expand container divs to 100% when decreasing browser window?

gauchomatt
1 New Member
I have a liquid site which expands perfectly when the browser window is larger than the actual content. However, when I decrease the browser window size to a point that it's smaller horizontally than the content, my background div's and their images start to decrease horizontally.

I think it has something to do with my #main div as well as my #wrap div's. They are the ones decreasing horizontally and eliminating everything in their path except for images!

Here is my css for my main framework:

Expand|Select|Wrap|Line Numbers
  1. html, body { height: 100%; background-color: #d9d9d9; font-family: "HelveticaNeue", "Helvetica Neue", Helvetica, Arial, sans-serif; text-shadow: rgba(255, 255, 255, 0.8) 0px 1px 0px; }
  2.  
  3. #wrap { width: 100%; min-height: 100%;}
  4. #header { background: #000 url('../images/head_bg.png') repeat-x; height:66px; }
  5. #subhead { background: #000 url('../images/subhead_bg.png') repeat-x; height:202px; }
  6. #main {background: #d9d9d9 url('../images/body_bg.png') repeat-x; min-height: 542px; overflow:auto; padding-bottom: 124px; /* must be same height as the footer */ clear:both; }
  7.  
  8. .container { width: 960px; margin: 0px auto; padding: 0px; border: 1px solid red; }
  9. .sidebar { float: left; padding: 0px; width: 200px; border: 1px solid red; }
  10. .content { float: right; padding: 0px; width: 730px; border: 1px solid red; }
  11.  
  12. #footer { position: relative; height: 124px; z-index: 20; margin-top: -124px; /* negative value of footer height */ clear:both; } 
  13. #social { background: #000 url('../images/social_bg.png') repeat-x; height: 63px; z-index: 20; }
  14. #bottom { background: #000 url('../images/bottom_bg.png') repeat-x; height: 61px; z-index: 20; }
  15.  
  16. #body_content { margin: 30px 0px 0px 0px; font-size:13px;  }
I have included a red border just for debugging purposes. I have found this same issue on some other sites as well. If you go to http://www.healthypayout.com (this is on a Mac) just make the browser window smaller horizontally, like pretty small, then you should have a scroll bar. Scroll over and you will see that the background images there are doing the same thing mine are.

If you need me to post my HTML here I can do so. Please help! Thank you all again. I have included two screenshots of what it does on my end in the .zip file.

Best,
Matt
Attached Files
File Type: zip Archive.zip (311.8 KB, 58 views)
May 14 '10 #1
0 1957

Sign in to post your reply or Sign up for a free account.

Similar topics

18
by: puzzled | last post by:
I have looked and looked and not found the answer to this one - just lots of references to this or that "hack" that is supposed to fix the problem (and it is a problem to some people). If I have...
2
by: André Hänsel | last post by:
When I write a simple HTML like <html> <head> <style> ... </style> </head> <body> <table> <tr> <td> </td> </tr> </table> </body> </html> and then set up a CSS like table { height: 100%;...
3
by: Petter Harnes | last post by:
We have a solution where we want to control the number of users logged in at the same time. So when the user log in we check number of currentusers agains allowedusers and increment a...
13
by: zn | last post by:
How can I cause a link on a page to open up a new browser window when the link is clicked on? I've noticed javascript code sometimes when I try to right-click a link and open it in another window....
3
by: Marcus Otmarsen | last post by:
During the last months I obeserved a growing number of web pages with popups inside a web page. I don't know the technique by which these in-page-windows are implemented (either Javascript or...
33
by: randau | last post by:
Linking to a Targeted Browser Window I'd like to open reference links to other web sites in a separate browser window from the browser window hosting my own web site pages. The Link Target...
10
by: santiago538 | last post by:
Hi, Is there any way to specify which monitor a Window.open() will launch a new browser window in on systems with more than one display. It would only need to work with Mozilla browsers, and not...
8
by: sun | last post by:
I want to do clean up routine to my database when the browser is closed. I have my code in session-end - but it never fires when the browser closes. I cant do onbeforeunload as it will be fired...
17
by: FAQ server | last post by:
----------------------------------------------------------------------- FAQ Topic - How do I find the size of a browser window?...
2
by: sachjn | last post by:
Hi, I need to have a table along with other UI items in page which resizes horizontally and vertically with the browser window. That means table should accoupy the remaining available space in...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.