473,490 Members | 2,486 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

height 100% issue on Firefox

3 New Member
Hello there

I am new to the forum, but was wondering if you could point me in the right direction?

I have a site that works fine in IE. The site was created by someone else and done using tables. So the page looks like this:-

A top image, left hand side nav bar. content next to it. And then bottom bar set to stay at bottom. Now the content area is set to overflow:auto, so the scroll bars appears within the content area and leave all the other areas locked in the screen.

This does not happen in firefox, the scroll bar instead appears for the full screen and not just for the content area itself.

Can you help?

Thank you

Ilesh
Aug 8 '06 #1
11 12658
Banfa
9,065 Recognized Expert Moderator Expert
You should post a link to the page so we can see the problem.

Start by validating your html at www.w3c.org (look on the right hand side for the HTML validator). to have the page work well cross browser it will need to be in complient HTML so that they can all understand it.
Aug 8 '06 #2
ilesh
3 New Member
Hello Banfa

To be honest I would just like to know how I could do this using XHTML and CSS?

Because we are thinking of converting the table structure into XHTML.
So really I should have posted the following question:-

We have a top image of width 100%
We have a left hand nav bar and then next to it is the content area
We also have a bottom nav bar which is locked to the bottom of the screen.
So in IE I know this works, but for Firefox, how could I make the content area scrollable in its own div tag? As the content may not be large enough therefore overflow would be set to auto. But if it is large enough then I would like the content area to 100% depending on the browser size. So if I resized the browser it should flow without problems. I say this because I have specified a height for the content area and it looks fine, but what if the browser is not running 800px by 600px? Then it would look wierd.

So really is there a way to make a div area scrollable and make it height 100%?

Sorry for the confusion before

Thanks
Aug 8 '06 #3
Banfa
9,065 Recognized Expert Moderator Expert
From you description you should be able to do what you want using XHTML and CSS, however in a case like this it is true that 1 sample webpage is worth 10000 forum postings :D

There is a problem in setting 100% height because it relates the height of an element to the height of it's container. However if that container is not of fixed height (like say the body of the document that sizes itself to the height of the content) then it will be dependent on the height of it's content so you end up with the contents height dependent on the container who's height is dependent on the content which clearly doesn't work.

I guess you have set the body to 100% and the content div to some other percentage. This works in MSIE but is not part of the CSS standard. The CSS standard does define ways of doing what you want but unfortunately MSIE is not standard complient enough to support them.

However mixing methods gives the following which sort of works in both IE and FireFox


Expand|Select|Wrap|Line Numbers
  1.  
  2. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  3.  
  4.  
  5. <html>
  6. <head>
  7. <meta name="generator" content="microsoft visual studio 6.0">
  8. <title></title>
  9. </head>
  10. <body style="height: 100%; margin: 0; padding: 0;">
  11.  
  12. <div style="position: absolute; top: 5%; left: 5%; right: 5%; bottom: 5%; height: 90%; background-color: #ccf; overflow: auto;">
  13.  
  14. <!-- Content Here ->
  15.  
  16. </div>
  17.  
  18. </body>
  19. </html>
  20.  
Aug 9 '06 #4
ilesh
3 New Member
Thanks for your help Banfa, I am looking at this, but am currently assigned another project. When I return to this project I will try this out.

Again thanks for your input, I am learning a lot.

Ilesh
Aug 11 '06 #5
Samus
4 New Member
hello, I'm a newcomer who found this place just for the same issue, very interesting forum I'll try to be around.


About this I have a question, you've said that:
There is a problem in setting 100% height because it relates the height of an element to the height of it's container.
which is basically true -but- body is not the outermost element, html is and html always have the width and height of the browser's client area.

An example:
Expand|Select|Wrap|Line Numbers
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3.   <head>
  4.     <title></title>
  5.     <style>
  6.       html {
  7.         border: 1px solid red;
  8.       }
  9.     </style>
  10.   </head>
  11.  
  12.   <body>
  13.   </body>
  14. </html>
So, what's wrong here? why setting the height of the body tag does not renders it based on it's container (which is the html tag).
Thank you.
Oct 1 '06 #6
Samus
4 New Member
hi! I've found something interesting here: http://apptools.com/examples/tableheight.php it shows a way to do it setting both the height of the html and body tags to 100%, it says that does not work on IE on Mac but here: http://blog.deconcept.com/2005/01/02...l-flash-embed/ is another example that applies the same technique and it supposed to work even there.
Oct 1 '06 #7
rapsody
2 New Member
I have a similar problem I using xhtml strict in firefox....I have a header <div> then a middle <div> and thjen a footer <div>.

The middle <div> is made up of two <div> left and right (parraell) the data in each is expandable. if the right txt has more txt than the left one the footer <div> starts to display in the right <div>.

I have put the height of each left and right <div> 100% and the middle <div> 100% but it doesn't solve the problem...any ideas
Oct 4 '06 #8
toxicpaint
58 New Member
Try adding this to your footer css

clear: both;

From what you described, I had the same problem...
Oct 4 '06 #9
drhowarddrfine
7,435 Recognized Expert Expert
You have to keep asking the question "100% of what?" Even though you set 100% height on the middle div, it is 100% of what? If the body is the next parent element, is it set to 100%? Is the next element, html, set to 100%? The html element is the only element that gets a default size which is the viewport of the browser but you still must specify if you want it to be 100% of that.

Another way around this is to set an actual size to the middle div using ems or px. Then 100% becomes 100% of that.

In any case, Firefox is doing all this correctly.
Oct 4 '06 #10
vtkiet05
1 New Member
This is complete: Create Master page using DIV tags

[html]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<style type="text/css">
<!--

body, p, td, li, div, html
{
font-family: arial, verdana, helvetica, monospace;
color: #000080;
font-size: small;
height:100%;
width:99%;
}
#leftspace {
float:left;
text-align: center;
width: 10%;
height:100%;
background-color:#006699;
background-repeat:repeat-y;
}

#container
{
float:left;
text-align: center;
width:78.56%;
}

#rightspace {
float:left;
text-align: center;
width: 10%;
background-color:#006699;
background-repeat:repeat-y;
height:100%;
}

#leftscroll {
float:left;
text-align: center;
width: 7px;
height:100%;
/*background-image:url(images/home_bg05.gif);*/
background-color:#ff0000;
background-repeat:repeat-y;
}
#rightscroll {
float:left;
text-align: center;
width: 7px;
height:100%;
/*background-image:url(images/home_bg04.gif);*/
background-color:#ff0000;
background-repeat:repeat-y;
}

#header {
float: left;
border: 1px solid #8690ab;
text-align: center;
height: 100px;
width: 99.8%;

}
#left {
float:left;
width: 20%;
height: auto;
border: 1px solid #8690ab;
}

#middle {
float:left;
width: 59.49%;
border: 0px solid #8690ab;
height:auto;
}

#right {
float:left;
width: 20%;
height: auto;
border: 1px solid #8690ab;
}

#footer{
float: left;
border: 1px solid #8690ab;
text-align: center;
height: 60px;
width: 99.8%;
}

-->
</style>
</head>

<body style="width:99.8%; border: 1px solid #ff0000 ">
<div id="leftspace"></div>
<div id="leftscroll">&nbsp;</div>
<div id="container">

<div id="header">This is the header section</div>

<div id="left">
Category 1 <br />
Category 2 <br />
Category 3 <br />
</div>

<div id="middle">
<br />
A frequently asked question in CSS forums is how to create pages that stretch vertically to fill the browser window, regardless of the amount of content. With tables, you would nest your entire design in a table with a single cell and set both the cell and table's height to be 100 percent. With CSS, it's also quite simple and easy. In this tutorial, you will learn the basic CSS technique for making pages fill the browser window, which you can also use any time you have a div that you want to stretch to fill its parent.
<br />

</div>

<div id="right">Column 3 content </div>

<div id="footer"><br />This is the footer section<br />Mangrove CM, Vietnam </div>
</div>
<div id="rightscroll">&nbsp;</div>

<div id="rightspace">&nbsp;</div>
</body>
</html>[/html]
Oct 18 '07 #11
drhowarddrfine
7,435 Recognized Expert Expert
I guess you didn't notice this topic is over a year old?
Oct 18 '07 #12

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

Similar topics

0
1677
by: Robert | last post by:
Hi, I am having some difficulty to have two DIVs or cells on top of eachother that take (at least) 100% of the browser height. First I tried to use DIVs and set them HTML and BODY height to...
3
5509
by: TheXenocide | last post by:
Hello, First and foremost I'll describe a bit about my problem: I'm trying to make a site layout using ASP.NET 2.0 in Visual Studio .NET 2005 Beta 2. The site is a table based layout that is...
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'...
3
12838
by: monkey64 | last post by:
Hello Well I'm a newbie to CSS and I have an issue with using 100% height when viewed in Firefox. If I use a pixel measurement, everything works well. I uploaded it to my site:...
6
3865
by: amandadev | last post by:
Hi there, I actually have two problems with the following site: http://coombes.amandadevries.com: 1. Why does Firefox ignore my request for a 'red' background for my ..container? IE doesn't....
7
8646
by: Phlip | last post by:
HTMLers: Start with this simple HTML: <table border='1' width='100%' height='90%'> <tr><td> <div style='overflow: auto'> </div> </td></tr> </table>
3
3231
by: Arielle | last post by:
Problem: Using an XHTML doctype for all our pages, this is not optional. The layout the client wants to use requires the site to be "full screen" with a header, footer, horizontal menu, and main...
1
3343
by: mascouta | last post by:
I have a lot of problems with IE browser, one of them is described in this topic. in my website i have div Calculator with background image. it displayed perfectly with Firefox browser however in IE...
6
2745
by: R144N | last post by:
Hi Everyone, I have finally taken the step to bring a site to the 21st century with HTML 4.01 with the height tag having been deprecated. I have read numerous articles claiming that the CSS...
2
2376
by: =?Utf-8?B?UGhpbCBKb2huc29u?= | last post by:
Hi, I have a gridview and I need it to display correctly in Opera. I need to set the row height, so that even on the last page of data all the rows are the same height as on the other pages. ...
0
6974
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
7146
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
6852
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
7356
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
5448
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
4878
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
3084
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
1389
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
628
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.