Philippe Wittenbergh wrote: > On Mar 7, 2009, at 2:17 PM, Jim Albert wrote: > >> I have an example of a table defined with a height to one of the cells >> and I would like some text to be aligned to the right and bottom of >> that >> cell. >> >> Here is the example: >> http://www6.netrition.com/anchor_bottom.html >> I would like the blue text "lower right" to be anchored to the bottom >> and right of its surrounding table cell. >> >> Obviously, there is no additional information in the above html that >> would produce what I want, but that's the base of the simple example I >> am using. >> >> I tried applying a style of position:absolute;bottom:2px;right:2px in >> this example: >> http://www6.netrition.com/anchor_bottom_position_absolute.html >> but you can see the blue text gets anchored to the lower bottom corner >> of the browser not the table cell. > > That is to be expected. The containing block for that absolute > positioned element is the root element. To achieve what you want, in > your simple example above, you'd need to make the parent div the > containing block (relative positioning it): > <DIV style="overflow:hidden;height:300px; position: relative">
Thank you. The position:relative on the parent div solved it. > >> How can I anchor that text to the lower right corner of its cell? > > If the cell has a declared height (e.g. td {height:300px;}), you can > then wrap the contents of the cell in a div, set the height to 100%, > and then just as in the above example. > > PS - try to present test cases with valid html please. Was there something other than the lack of a DOCTYPE tag that you noticed? That was the only thing the w3 validator showed. -- Jim Albert ______________________________________________________________________ css-discuss [cs...@lists.css-discuss.org] http://www.css-discuss.org/mailman/listinfo/css-d List wiki/FAQ -- http://css-discuss.incutio.com/ List policies -- http://css-discuss.org/policies.html Supported by evolt.org -- http://www.evolt.org/help_support_evolt/