Looking to achieve precise positioning of an element just off the top of the screen, specifically a sliding menu. Utilizing position: absolute
and top: 0px
is straightforward, but this aligns the element based on its top edge.
Is there a way to achieve the same effect using the element's bottom edge?
For instance, if we have:
#foo {
position: absolute;
top: 0px;
}
This would result in the following layout:
-------------------------------------------
| | |
| id="foo" | <body> |
---------------- |
| |
| |
-------------------------------------------
However, is it possible with CSS to obtain the following layout:
----------------
| |
| id="foo" |
-------------------------------------------
| |
| <body> |
| |
| |
| |
-------------------------------------------
The goal is to position a div at the very top of the document using its bottom edge as reference, taking into account that the height of the content within this div may vary. Can CSS accomplish this type of positioning or does it require additional tools?