On May 8, 2007, at 6:58 AM, Mike Wilson wrote: > I have a problem with relative positioning, containing block, > and percentages. > > I have an absolutely positioned outer DIV, and a relatively > positioned inner DIV. My goal is to shift the inner DIV > halfway to the left and up, using percentages. See code > below: > > [...] > > My expectation is to see the text with the red border > shifted both up and left from the green (outer) box. In > standard browsers like Firefox and Opera I only get a shift > sideways and not upwards, though in IE I get both > directions. > > I have been trying to find support for the standard browsers' > behaviour in the CSS spec, but have failed. Sections 9.3.2, > 10.6.4 and 10.6.7 suggest, at least to me, that I should be > getting the upwards shift with my layout. > > Can anybody point to something that explains this? Did I miss > something in the spec or are both Firefox and Opera wrong > (not likely) ?
How much offset for top do you actually expect ? ----- CSS 2.1, 9.3.2 Box offsets For 'top' <quote> Percentages: refer to height of containing block </quote> But the height of the containing block [1] in this case depends on the element itself (the height is auto), which makes the whole thing pretty much undefined. Then, regarding the computed values for relative positioned boxes, 9.3.2 makes an explicit reference to 9.4.3 [2]. Result: unless the absolute positioned has a height explicitly declared, the rel. pos. box won't move. of course, you could make the rel.pos. box an absolute positioned box, and solve the issue. [1] the absolute positioned div [2] <http://www.w3.org/TR/CSS21/visuren.html#relative-positioning> PS - Safari, Konqueror, iCab all do the same thing as Gecko and Opera. Philippe --- Philippe Wittenbergh <http://emps.l-c-n.com> ______________________________________________________________________ css-discuss [EMAIL PROTECTED] http://www.css-discuss.org/mailman/listinfo/css-d IE7 information -- http://css-discuss.incutio.com/?page=IE7 List wiki/FAQ -- http://css-discuss.incutio.com/ Supported by evolt.org -- http://www.evolt.org/help_support_evolt/
