473,809 Members | 2,660 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Positioning workaround for Mac IE5 bug (nasty)

<div style="position : relative;> <!-- I'm the parent -->
blah blah blah
<div style="position : absolute; bottom: 0;> <!-- I'm the child -->
blah blah blah
</div>
</div>

The bottom of the child div lines up with the bottom of the parent div
in Win IE6 and in Win NS6. However, Mac IE5 has a nasty bug -- it lines
up the bottom of the child div with the *top of the body* -- I kid you
not -- in other words, it shoves the child div completely off the top
of the screen!

(BTW, Mac IE5 is the most recent version for the Mac and is still used
by millions of people, especially the roughly 50% of Mac users who
haven't switched to OSX.)

I tried assigning various properties to the html and body themselves --
100% height, relative positioning, absolute positioning, in various
combinations -- nothing helped.

After <self-pity>much</self-pity> experimental time, I came up with a
slightly ugly workaround:

<div style="position : relative;> <!-- I'm the parent -->
blah blah blah
<div style="position : absolute; /*I'm the child*/
height: 130px;
top: 100%;
margin-top: -130px;>
blah blah blah
</div>
</div>

What's happening here is that the top:100% is shoving the child down
until it's just *below* the parent, and then the negative margin-top is
pulling it back up again (by an amount equal to its own height) so that
the bottom of the child is lined up with the bottom of the parent --
which is what I was trying to accomplish in the first place.

BTW, you may safely assume that the parent div is at least a few
hundred pixels tall. Actually the child's negative margin-top needs to
be slightly *more* than its own height (to compensate for child's
margins etc.), but I wanted to keep the code clear here.

This works in Win IE5.01/5.5/6, Win NS6, and in the villain of this
little episode, Mac IE5. The workaround is nasty because it requires
me to specify in advance the height of the child div (which I'd rather
not do) since the negative margin-top needs to be based on that height.
I tried a slightly simpler version, with top: 95% and no negative top
margin -- but then the child kept shifting its vertical position
depending on the height of the parent div, so I had to keep changing
the percentage. In this case it's easier to predict/specify the height
for the child than the parent, but of course neither way is very nice
-- I'd rather not predict/specify any fixed heights.

If anybody knows of a better way to get Mac IE5 to behave itself with
respect to a simple bottom: 0 absolute position, I'd love to hear it.
Also, if there are any gotchas with this workaround that haven't
occurred to me, I'd like to hear that too.

Thanks.
Jul 20 '05 #1
0 1773

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

Similar topics

4
2719
by: Jane Withnolastname | last post by:
I am trying to re-work an old site by replacing the html with css. On the main page, I have a logo image which I needed centred on the initial screen. I found the solution here: http://www.wpdfd.com/editorial/wpd0103.htm#toptip (the second example) The problem is, under the image is a large table. But using the above positioning, now the table starts at the top of the page and runs underneath the image.
10
2257
by: Cezary | last post by:
Hi Folks! I wrote this below code and I want to get this effect: 727px] ] but, there must be some errors. Please give me some advices. Regards,
12
101963
by: John Smith | last post by:
Is it possible to position a DIV so that it will always be at the bottom of the screen without having to use absolute positioning or using the background image workaround? Thank you!
4
1815
by: Mage | last post by:
Dear All, I am writing a database import script in python and I would like to print the percentage of the process to the last line. I would like to update the last line at every percent. You know what I mean. How can the cursor be positioned to the last line or somewhere else on the screen? Curses starts with clearing the whole screen and it is overkill. Many modules are on the net but I would like to resolve this simply task with...
1
2084
by: Eric | last post by:
I have a page with some ASP.NET controls at the top and a datalist which might include anything from 1 to 25 elements below them, all laid out with absolute CSS positioning. The problem I'm having is that when the datalist goes off the bottom of the page and adds a scrollbar (which in itself is fine with me), the the last element of the list runs right up against the browser status bar, with none of the whitespace I would expect. If I...
3
1975
by: Axel Siebenwirth | last post by:
Hi, I would really love to get some help from you since I am starting to become completely desperate with something quite simple... I am trying to transfer a fixed-positioning-implementation for IE from a tutorial page (http://limpid.nl/lab/css/fixed/header-and-left-sidebar) to my site: http://www.refugio-thueringen.de/dev/dev.html. Everything works fine with FF and also it works with IE but only on the tutorial site not in my...
3
1054
by: Daniel | last post by:
Hey guys My last ASp.net site i did was in Vs 2003. In VS 2005 i notice that it doesnt seem to have abolute positioning? In 2003 for examplei could drag a text box place it where i want and voila. But in Vs 2005 i seem to have to use tables again for my layout and then place text boxes inside that? Is there no way to use absolute positioning in the designer like in VS 2003? if not why was it changed?
3
3508
by: vunet | last post by:
When I use image as a bullet within LI element I have different image positioning results in Firefox and IE6. IE6 puts the image on top and far from left LI's border. Firefox puts it nicely in the middle and very close to left border. How do I control bullet image positioning? Please advise a nice hack. Thanks
20
2829
by: mehstg1319 | last post by:
Hi there Not sure if anyone can help me, I am working on a site for my university, and am having a bit of trouble with css positioning. I am very new to css and do not know very much about it. Here is the link: http://homepages.feis.herts.ac.uk/~bp6ar/bus_intel/matrix/matrix.html Basically, the problem is that the ticks on the grid look perfectly
0
9721
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...
0
9603
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10640
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10387
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
10120
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9200
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...
0
6881
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();...
1
4332
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 we have to send another system
3
3015
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.