![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
which is the container for #main? |
|
I ask because I expect #middle to be the container for #navigation and #main, and the three divs #header, #main and #footer to follow each other vertically on the page, so positioning the top of #main at 0px absolute should position it inside the containing #middle, and hence level with the top of #navigation, but instead that seems to position it at the top of the page. |
#3
| |||
| |||
|
|
supposing I have: body div id="page" div id="header" /div div id="middle" div id="navigation" /div div id="main" /div /div> <!-- middle -- div id="footer" /div /div> <!-- page -- /body which is the container for #main? |
|
I ask because I expect #middle to be the container for #navigation and #main, and the three divs #header, #main and #footer to follow each other vertically on the page, so positioning the top of #main at 0px absolute should position it inside the containing #middle, and hence level with the top of #navigation, but instead that seems to position it at the top of the page. |
#4
| |||
| |||
|
|
which is the container for #main? The initial containing block, i.e. the viewport of the browser: http://www.w3.org/TR/CSS21/visudet.html#containing-block-details>. I ask because I expect #middle to be the container for #navigation and #main, and the three divs #header, #main and #footer to follow each other vertically on the page, so positioning the top of #main at 0px absolute should position it inside the containing #middle, and hence level with the top of #navigation, but instead that seems to position it at the top of the page. Put a position: relative in the parent element. Absolute elements are positioned from the nearest absolute, static, or fixed ancestor. |
#5
| |||
| |||
|
|
On 2009-07-28, Joshua Cranmer <Pidgeot18 (AT) verizon (DOT) invalid> wrote: Put a position: relative in the parent element. Absolute elements are positioned from the nearest absolute, static, or fixed ancestor. You mean the nearest absolute, relative or fixed ancestor. In other words, the nearest ancestor that _isn't_ static. |
#6
| |||
| |||
|
|
Ben C wrote: On 2009-07-28, Joshua Cranmer wrote: Put a position: relative in the parent element. Absolute elements are positioned from the nearest absolute, static, or fixed ancestor. You mean the nearest absolute, relative or fixed ancestor. In other words, the nearest ancestor that _isn't_ static. Dammit, I erased static twice just to put relative in and I still mistyped it as static? |
#7
| |||
| |||
|
|
On Wed, 29 Jul 2009 17:26:47 -0400, Joshua Cranmer wrote: Ben C wrote: On 2009-07-28, Joshua Cranmer wrote: Put a position: relative in the parent element. Absolute elements are positioned from the nearest absolute, static, or fixed ancestor. You mean the nearest absolute, relative or fixed ancestor. In other words, the nearest ancestor that _isn't_ static. Dammit, I erased static twice just to put relative in and I still mistyped it as static? Another tragic sufferer of static cling. |
#8
| |||
| |||
|
|
Is there a Best of Usenet newsgroup I can forward this to? |
#9
| |||
| |||
|
|
John Hosking wrote: On Wed, 29 Jul 2009 17:26:47 -0400, Joshua Cranmer wrote: Ben C wrote: On 2009-07-28, Joshua Cranmer wrote: Put a position: relative in the parent element. Absolute elements are positioned from the nearest absolute, static, or fixed ancestor. You mean the nearest absolute, relative or fixed ancestor. In other words, the nearest ancestor that _isn't_ static. Dammit, I erased static twice just to put relative in and I still mistyped it as static? Another tragic sufferer of static cling. Is there a Best of Usenet newsgroup I can forward this to? |
![]() |
| Thread Tools | |
| Display Modes | |
| |