473,385 Members | 2,003 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

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 1752

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

Similar topics

4
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:...
10
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
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
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...
1
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...
3
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...
3
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...
3
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...
20
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....
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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
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,...

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.