You are here: Re: Nuts « HTML « IT news, forums, messages
Re: Nuts

Posted by Jon Slaughter on 04/16/07 21:42

"Ben C" <spamspam@spam.eggs> wrote in message
news:slrnf26b8r.hi7.spamspam@bowser.marioworld...
> On 2007-04-16, Jon Slaughter <Jon_Slaughter@Hotmail.com> wrote:
> [...]
>> What I need to know is how nested containers with different combinations
>> of
>> positions work. On my sub menu with a position:fixed and if I do
>> position:absolute on any element contained in it then my coordinates
>> always
>> end up relative to viewport.
>>
>> I've tried many things..
>>
>> if I do something like
>>
>><div style="position:fixed">
>><div style="position:relative">
>></div></div>
>>
>> and in the second div dot he coordinates refer relative to the fixed
>> container of the first? When I do stuff like that in my original code it
>> totally screws up the menu. That is, I have to have the sub menu as fixed
>> but when I try to create a container inside that that has relative coords
>> it
>> then screws up.
>>
>> Maybe I need to specify something else besides display:inline or block?
>
> If you set position: fixed or position: absolute, you get display: block
> whatever you specify.

? You mean as a default or that I cannot change it? If I use display:inline
it works and looks different, atleast in FireFox, than display:block. The
block shifted down while the inline is not.


> absolute: origin is containing block infimum point (containing block is
> generally nearest ancestor with position of anything except static)
>
> fixed: origin is viewport infimum.
>
> relative: origin is infimum of normal-flow box.
>
> Yes the terms are very confusingly named. Relative is the odd one out--
> the box is flowed normally, and then offset at the last minute from its
> normal-flow position, leaving a gap where it was.

What I'm having trouble is, is how they inherit the positioning from there
parent containers. I wasn't sure if it was inheriting or not before but my
simple example seems to work(See other post). The issue seems to be that I
have to specify the height because the user agent isn't calculating it for
me the way I thought it would. I can specify the height but I'd rather not
if possible.

Thanks,
Jon

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация