Right Aligned Nested Div Goes Off

Right Aligned Nested Div Goes Off

am 08.01.2008 16:42:33 von vunet.us

Hello,
I have a div inside of the div:



container


with that CSS above, 'right' div is aligned to right of the page, not
container, even though it is nested. It gets fixed when I set
container to have position:absolute. What CSS properties should I be
looking at in this case?
Note: example above is not the test-case but just an explanation.
'container' is nested within other HTML tags in real code.

Thank you for ideas.

Re: Right Aligned Nested Div Goes Off

am 08.01.2008 17:30:03 von jeff

vunet wrote:
> Hello,
> I have a div inside of the div:
>
>


>
> container
>

>
> with that CSS above, 'right' div is aligned to right of the page, not
> container, even though it is nested.


Absolute is always absolute to the page. Relative is to it's normal
place in the document flow. You probably want to look at float: right,
and then you may wish to float your other div.

Jeff



It gets fixed when I set
> container to have position:absolute. What CSS properties should I be
> looking at in this case?
> Note: example above is not the test-case but just an explanation.
> 'container' is nested within other HTML tags in real code.
>
> Thank you for ideas.

Re: Right Aligned Nested Div Goes Off

am 08.01.2008 17:53:19 von Bergamot

vunet wrote:
>
> 'right' div is aligned to right of the page, not
> container, even though it is nested. It gets fixed when I set
> container to have position:absolute.

Your code snippet is not telling the whole story. Post a URL.

--
Berg