| | |
100% Doesn't Work
Please support our HTML and CSS advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Aug 2008
Posts: 17
Reputation:
Solved Threads: 0
I've been trying all methods to stretch the background color to fill 100% of the page but it doesn't work in Firefox 3. It just stretches to where the content is. It seems to work fine in IE 7, but there is some space to scroll up and down.
Here's my CSS:
And this is my HTML:
Many thanks to those who help me.
Here's my CSS:
css Syntax (Toggle Plain Text)
body { height: 100%; background-color: #666; margin: 0px; margin-top: -1px; background-image: url(Background.jpg); } .container { height: 100% !important; min-height: 100%; background-color: #252525; width: 80%; min-width: 1000px; max-width: 1400px; border: #444 1px solid; margin: 0px; }
And this is my HTML:
html Syntax (Toggle Plain Text)
<body> <center> <div class="container"> <!-- Open --> <div class="header"></div> <!-- Header --> <!-- Content --> <div class="page"> <div class="content">Content</div><div class="sidebar"> Sidebar </div> </div> <!-- Footer --> <div class="footer"> <br /><br /><br /><br /><br /><p><span class="footercont"> Footer </span></p></div> <div class="fill"></div> <!-- Fill --> </div> <!-- Close --> </center> </body>
Many thanks to those who help me.
CLICK---> GeekPolice
•
•
Join Date: Jun 2004
Posts: 247
Reputation:
Solved Threads: 1
yea never gotten 100% height working in all browsers w/o js. change your .container to #container
If the div is less than the window height it changes the div height to match the window, if its greater then the 100% will work fine. Also when the window is resized it changes the height to make sure its up to date.
HTML and CSS Syntax (Toggle Plain Text)
function divSize() { winH = document.body.offsetHeight; totalHeight = document.getElementById('container').offsetHeight; if(winH > totalHeight) { document.getElementById('container').style.height=winH + "px"; } window.onresize = function() { divSize(); }
If the div is less than the window height it changes the div height to match the window, if its greater then the 100% will work fine. Also when the window is resized it changes the height to make sure its up to date.
•
•
Join Date: Jun 2004
Posts: 247
Reputation:
Solved Threads: 1
add this to the head of the pages
HTML and CSS Syntax (Toggle Plain Text)
window.onload = function() { divSize(); } or <body onload="divSize();">
It can't be done.
The web is NOT designed to fill a screen. You provide content, and it expands downward to fill whatever area is needed, running off the screen downward if necessary.
Remember that different computers have different resolutions. Combine that with different browsers, and it is quite impossible to make a web page that fits into a screen.
IE has nonstandard extensions to do this, but nobody else implements them.
The web is NOT designed to fill a screen. You provide content, and it expands downward to fill whatever area is needed, running off the screen downward if necessary.
Remember that different computers have different resolutions. Combine that with different browsers, and it is quite impossible to make a web page that fits into a screen.
IE has nonstandard extensions to do this, but nobody else implements them.
Daylight-saving time uses more gasoline
You may want to check this blog posting.
http://ryanfait.com/sticky-footer/
I think you can modify it in order to achieve your goals. Hope it solves your issue.
http://ryanfait.com/sticky-footer/
I think you can modify it in order to achieve your goals. Hope it solves your issue.
" Of all the things I've lost,
I miss my mind the most...."
Mark Twain
I miss my mind the most...."
Mark Twain
![]() |
Similar Threads
- svchost.exe 100% cpu usage pissing me off :( (Windows NT / 2000 / XP)
- 100% CPU USAGE on and off! ;/ (Windows NT / 2000 / XP)
- height: 100% - cannot get this to work (HTML and CSS)
- CPU at 100% after installing broadband!?! (Windows NT / 2000 / XP)
- Can't get multimedia keys to work on mac keyboard (Apple Hardware)
- Mega Nerd (Geeks' Lounge)
Other Threads in the HTML and CSS Forum
- Previous Thread: Input Button Background with i18n problem
- Next Thread: How do I upload my flash website to the internet?
| Thread Tools | Search this Thread |
appointments asp background backgroundcolor beta browser bug calendar cart cgi code codeinjection corporateidentity css design development displayimageinsteadofflash dreamweaver emailmarketing epilepsy explorer firefox flash form format google griefers hackers hitcounter hover html ide ie7 ie8 iframe image images internet internetexplorer intranet iphone javascript jpeg layout macbook maps marketshare microsoft mozilla multimedia navigationbars news offshoreoutsourcingcompany opacity opera optimization pnginie6 positioning problem scroll seo shopping studio swf swf. textcolor timecolor titletags url urlseparatedwords visual visualization web webdevelopment webform website windows7






