473,799 Members | 3,149 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

percentage height divs in Mozilla

Vic
I've managed to achieve the effect I wanted in IE6 - although I had to
use an experession to set the vertical height of a div (I want it to
have an overflow and scroll) but I can't work out a way to duplicate
the effect in Mozilla/Firefox

the code is here:
http://www.fogcat.co.uk/example/example.html

Can anyone point me in the right direction - or at least tell me if it
is or isn't possible to get the same functionality in Firefox

(I don't have access to Opera, Konquerer and Safari at the moment so
I'm not even starting to worry about them.)
Jul 20 '05 #1
8 7418
Vic wrote:

set the vertical height of a div (I want it to
have an overflow and scroll) but I can't work out a way to duplicate
the effect in Mozilla/Firefox

http://www.fogcat.co.uk/example/example.html


FWIW, as a user, I find these scrolling divs to be a big pain in the
arse, especially with keyboard navigation. I hear mousewheels don't play
nice with them, either.

What do you find so terrible about normal scrolling that would make you
want to use one of these ishy things? Just curious.

--
Reply email address is a bottomless spam bucket.
Please reply to the group so everyone can share.
Jul 20 '05 #2
If ALL else fails and you simply must have a segment that scrolls like that,
you can always use frames (ick).

Jeff
Jul 20 '05 #3
Vic wrote:
I've managed to achieve the effect I wanted in IE6 - although I had to
use an experession to set the vertical height of a div (I want it to
have an overflow and scroll) but I can't work out a way to duplicate
the effect in Mozilla/Firefox

the code is here:
http://www.fogcat.co.uk/example/example.html

Can anyone point me in the right direction - or at least tell me if it
is or isn't possible to get the same functionality in Firefox

(I don't have access to Opera, Konquerer and Safari at the moment so
I'm not even starting to worry about them.)


Imteresting that you use the Strict DTD and yet use MS Proprietory code
for height which only IE recognizes (do you see the conflict there?).
Use the proper height declaration as per:
http://www.w3.org/TR/CSS21/visudet.html#propdef-height
which every browser, including IE, recognizes. Then you will have a
vertical scrollbar for all.

--
Gus

Jul 20 '05 #4
Vic
Gus Richter <gu********@net scape.net> wrote
Imteresting that you use the Strict DTD and yet use MS Proprietory code
for height which only IE recognizes (do you see the conflict there?).
Use the proper height declaration as per:
http://www.w3.org/TR/CSS21/visudet.html#propdef-height
which every browser, including IE, recognizes. Then you will have a
vertical scrollbar for all.


Yes I know I'm using proprietory MS stuff - I started off trying to be
strict about the standards but the only way I could get the result I
wanted was to use the MS expression. I was hoping someone could point
me to a proper standard way of doing it.

The problem is, I believe, that I need a fixed (pixel) space above my
scrolling div for the logo, menu etc, but then I want the scrolling
area to expand to fill the rest of the window: therefore the height of
my scrolling div needs to be something like 100% - 170px.

If I use a fixed height like 400px things "work" but the vertical
height of the scrolling div doesn't change when the window is resized.
http://www.fogcat.co.uk/example/example2.html

If I use a percentage height (say 50%) it's closer - but again the
size of the scrolling div doesn't match the window size properly.
http://www.fogcat.co.uk/example/example3.html

I could do this if my scrolling div was related to the window by
percentage values all round but because i want a fixed size logo at
the top I'm getting difficulties.
Jul 20 '05 #5
Vic
I had a bit of a re-think and tried something slightly different, all
standard I think:
http://www.fogcat.co.uk/example/example5.html

With some interesting results, when you display the page in IE6 it's
not correct on initial display, but if you resize the IE window even
slightly it corrects its self and displays how I was hoping it would.
Very odd... but it is IE.

In Firefox it degrades fairly safely - but it still doesn't display a
scroll bar for the content div. It seems as though in Firefox it's
allowing the containing div (bottomHalf) for be auto expanded even
though I set its height to 100%.
Jul 20 '05 #6
Vic wrote:
I had a bit of a re-think and tried something slightly different


I played around with your problem and came up with this.
I hope that it will help.

--
Gus
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>Untitl ed Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
body {background-color: white; margin: 0; padding: 0; height: 100%; }
#menuBar { position: absolute; top: 100px; background-color: Black;
color:white; width: 100%; height: 50px; }
#logo {position: relative; top:0; left: 10%; width: 80%; border: 1px
solid red; height: 160px; }
#bit2Wrapper { position: absolute; top: 0; left: 10%; width: 80%;
height: 100%; }
#bit2 {position: relative; top:0; left: 10%; width: 80%;
background-color: silver; overflow: auto; height: 200px; top:50%;
margin-top: -20px; }
</style>
</head>
<body>
<div id="logo">
LOGO<br>
This is the latest - trying to center the scrollable box in the
available space and then also when resized.
</div>
<div id="menuBar">
The Menu Bar
</div>

<div id="bit2Wrapper ">
<div id="bit2">
<p>Exercise: to center the scrollable box within the available space
below Logo and Menu Bar and maintain this centering on page resizing (as
I understand the problem).<br>
One thing I don't understand is why you wish the Menu Bar to overlap the
Logo (dimension error? Red border applied).</p>
<p>Although it may be possible, to center a percentage valued box, I'm
unable to achieve it,
so I'm presenting a method where the scrollable box is of a fixed height
value and hopefully it will be either useful as is, or help to achieve
it by using a percentage height value.</p>
<p>All items are clear by looking at the code. The only item which may
require explanation is the method I used to achieve the vertical
centering.</p>
<p>The way I did it, is to position the top edge of the scrollable DIV
down with top:50% and then applied the following formula to get the
value for margin-top:</p>
<pre>
(Logo Height/2) - (Scrollable DIV Height/2)
</pre>
<p>A caveat to this is that overlapping will occur if screen size is
sufficiently decreased.<br>
--<br>
Gus</p>
</div>
</div>

</body>
</html>
Jul 20 '05 #7
Vic
Thank's for all your help there, much appreciated. I have now got
something that seems to work - it involves using some very thick top
and bottom borders to position the scrolling area.

I "borrowed" the idea from:
http://www.stunicholls.myby.co.uk/layouts/bodyfix.html

My implementation is at
http://www.fogcat.co.uk/example/ex10.html
Jul 20 '05 #8
Vic wrote:
Thank's for all your help there, much appreciated. I have now got
something that seems to work - it involves using some very thick top
and bottom borders to position the scrolling area.

I "borrowed" the idea from:
http://www.stunicholls.myby.co.uk/layouts/bodyfix.html

My implementation is at
http://www.fogcat.co.uk/example/ex10.html


I'm glad you have found another method, but you do realize that sadly
this one won't work with IE 5.5, whereas the method I presented does?

--
Gus
Jul 20 '05 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
5939
by: Put 030516 in email subj to get thru | last post by:
I've always been bothered about having to statically declare the size of a Java applet window (container?) in the calling HTML. I've always wanted the moral equivalent of width=50% statement (of the window or frame). I can sort of get an example working in a Mozilla browser: > <!-- This works on Mozilla only (and maybe netscape) --> > <script language="Javascript"> > document.write( "<applet code=MyApplet.class width=" > +...
0
2384
by: null Effects | last post by:
I made a page that has some divs that I would like to line up next to each other. I used percentage values to set their positions and sizes, but in IE6 there are breaks in between them and I can't figure out how to get them to line up. The page displays fine with Mozilla, and it also does not have this problem if I use pixels to specify the position and size. The page is here (http://cwp.byu.edu/red.html) and the stylesheet here...
0
1929
by: geod | last post by:
Folks, I'm relatively new to design all-css sites and have hit upon a snag. I'm sure it's something simple, but I haven't wrapped my mind around i yet. Here's the thing: My css file contains definitions for two divs that are meant to liv side-by-side in the page layout. Both are floated left. Both have th
2
5901
by: tomasio | last post by:
dear group, as nobody answered my recent posts (maybe they were too complicated) i just ask you to help me on a rather simple issue: how can i stretch divs to the full height of the viewport (in my case the browser window)? any help will be appreciated. -- kind regards,
6
10923
by: veerleverbr | last post by:
Hi, I have the following html: <div id="content"> <div id="leftpart">...</div> <div id="rightpart">...</div> </div> leftpart en rightpart are in the css set to float left. The content of leftpart and rightpart div is so that both divs have different height.
22
6977
by: Les Juby | last post by:
I am trying to adjust the window/table size of a website (www.worklaw.co.za) which has made use of DIV tags with its settings embedded in an CSS file. The client wants its width and height to adjust according to dynamic screen size, and I have been able to adjust the width to a percentage value which works fine. But if I try do the same with the height it shows some very strange results squashing the field to display about 3 lines.
6
28101
by: Hacking Bear | last post by:
Hi, I still don't quite fully understand how to handle mixing border/margin pixel width with percentage width. In the example below, I want to place side-by-side two DIV boxes inside a box. 1. Each box takes up 50% of the parent. 2. One of the box has a border width of 1px.
4
11693
by: hans.kindberg | last post by:
This is how my page looks like in IE6: http://www.freewebs.com/hasodaki/default.txt (without advertising banner, browsable with IE6 and to see the code with the other browsers) http://www.freewebs.com/hasodaki/default.html (with advertising banner) I would like it to look the same in Firefox 2.0 (and in Netscape 8.1.2). If possible even in Opera 9.02. Resize the window and see how the scrolling part resizes. I want my content to...
2
1231
by: damezumari | last post by:
I have three div blocks defined like this: #left1 { float: left; background-color: white; width: 184px; margin-right: 4px; text-align: left; }
0
9687
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
1
10228
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9072
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7565
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6805
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5463
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5585
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3759
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2938
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.