Position 'Fixed/Static' to Parent?

liunx

Guest
Hey guys,

I just discovered that 'fixed' positions an element in relation to the viewport, and of course depending on the browser the viewport may be <html> or <body>. And of course IE doesn't fully support fixed either, implementing it as static, but this can be supervented using the !important rule.

What I want to know is if it's possible to 'fix' an element in relation to it's parent element rather than body or html?

I have a certain problem with overlapping divs that only seems to be resolved using position fixed in NS/Moz, while IE works fine with position absolute/relative. For more info look at this thread (<!-- m --><a class="postlink" href="http://forums.webdeveloper.com/showthread.php?s=&threadid=31962">http://forums.webdeveloper.com/showthre ... adid=31962</a><!-- m -->).

But, as mentioned fixed is applied to the viewport, so seems to move in relation to resolution/text size. I want it to remain positioned inside it's container div through the use of selectors, inheritance, classes, whatever may work. Is it possible?

Edit: Perhaps a different wording would help:

Is it possible for a container div to be used as the body/html elements? Thus the container div would become (emulate) the viewport?

I'm asking because the main container div is positioned using top 50% and - topmargin with width 100% and a set height in ems. If this container area could be used as the viewport, then any positioned fixed div would position itself according to the main container block. Which is what I do with absolute, but as mentioned absolute ahs some 'weird' (quote Vladdy) functionality in my design, thus needs to be replaced with fixed.I was able to fix my problem by positioning the fixed div according to the viewport. I basically positioned it as an absolute div, except without a parent. It works in both NS7.1 and FF0.8, I don't know if it'll work in other browsers.

This still doesn't answer the question though :D .

Nor does it answer why this fixed div has a "shimmering" or "bouncing" text affect on mouseover. Any suggestions on how to fix that?If this container area could be used as the viewport... I believe the viewport is always defined to be the entire browser window. Hince the effect displayed by Meyer's complex spiral demo and my blab-n-lab pages. I believe I saw a pointer to a work around for IE in a thread here a few months ago but I'll be darned if I can find it now. The site had a jack knife or a swiss army knife "double background" if anyone remembers it.
 
Back
Top