473,498 Members | 1,830 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

scable div height 100% javascript?

20 New Member
I have a div which I have set to the height of 100% so it reaches the bottom of the page no matter the size of the browser resolution.

However, when the browser is resized the div no longer reaches the bottom of the page.

How do I set a div's height to 100% and keep it at this even if the browser window is resized?


Thanks.
Jun 21 '09 #1
5 4431
htmlnoob112233
20 New Member
I have relised that curently, the div only reaches the bottom of the visible page in the browser, if the browser where to scroll down, the div would not continue.

So I need the script to make the div reach the bottom of the page instead of just the bottom of the browser window's orginal location on the page.
Jun 21 '09 #2
acoder
16,027 Recognized Expert Moderator MVP
You can probably do this with CSS alone without JavaScript. Give the parent container (body) 100% height.
Jun 22 '09 #3
htmlnoob112233
20 New Member
Dosn't work. When I scroll down the div does not continue.
Jun 22 '09 #4
iam_clint
1,208 Recognized Expert Top Contributor
see -> http://matthewjamestaylor.com/blog/u...ail-pixels.htm

The holy grail of css is what you are speaking of
Jun 22 '09 #5
htmlnoob112233
20 New Member
Is this right because it's not working?

style.css
Expand|Select|Wrap|Line Numbers
  1. /* commented backslash hack \*/ 
  2. html, body{height:100%;} 
  3. /* end hack */
  4. html,body {margin:0;padding:0}
  5. #dname{
  6. min-height:100%;
  7. height:auto;
  8. * html #dname{height:100%;}
  9.  
  10. body    {
  11. background-image: url(img.jpg);
  12. background-position: left top;
  13. background-repeat: no-repeat;
  14. background-color:#ffffff;
  15. }
  16.  
  17. div.dname    {
  18. background-image:url(dimg.jpg);
  19. background-position: left top;
  20. background-repeat: repeat;
  21. }
  22.  
Jun 22 '09 #6

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

Similar topics

2
22985
by: patrick h. | last post by:
Greetings, I am encountering some issues regarding using float while desiring to set the height to 100%. This is likely due to my own misunderstanding of the way things actually function -- any...
6
6007
by: jslaybaugh | last post by:
I'm working on an ASP.NET 2.0 application and am having trouble with a very simple table layout. Using ASP.NET 2.0 it defaults to XHTML 1.0 Transitional and I am trying to comply. However, I...
4
12497
by: reycri | last post by:
I have a page that works as I intend in IE but not in Firefox: <html> <head> <title>Overflow Test</title> </head> <body style='overflow:hidden; margin:0; padding:0;'> <table border='0'...
0
2122
by: Markus Olderdissen | last post by:
i want to create my page with 100% height. <table height="100%"works but is not correct by default. i saw various information how to do it with stylesheet. i really have problems to create my page....
5
12406
by: Dag Sunde | last post by:
I ran into a problem i just *know* I've seen described a 100 times before I have an empty (so far) div with ist height: set to 100%. The main reason for this div is to show its white border-right...
4
4247
by: atma86 | last post by:
what up people, i'm writing an app which includes a page that has 2 divs side by side. the page is set up to fill the table containing the divs to 100% of the width of the pages. I want the height...
4
3764
by: debadrita | last post by:
How to make a window page 100% using javascript or ajax , I want to make all pages height 100% in all resolution. I have small contents, so as I view this page in other resolutio I find this page...
7
4588
by: msoliver | last post by:
Okay, I believe this is one of the biggest issues found using CSS/DIV layout. But, I haven't found a non-Javascript solution. I would like two DIVs - first DIV, say with a height of 20px. The...
2
5520
by: EmersonUK | last post by:
I’ve worked around a couple of times with DIVs using height:100% and I had no problems at all, testing on many browsers (IE7, FF3, FF2, Opera, Safari and Chrome). Now I’ve tried the same idea on a...
0
7125
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,...
1
6890
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
5464
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
4915
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...
0
4593
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3095
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3085
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1423
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
657
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.