W3C home > Mailing lists > Public > www-style@w3.org > June 2013

Relatively positioned box inside an absolutely positioned box

From: Glen Huang <curvedmark@gmail.com>
Date: Fri, 21 Jun 2013 13:39:53 +0800
Message-Id: <1D2EEFAB-3DD2-4C2E-9331-54A6CF9296F8@gmail.com>
To: www-style@w3.org
Not sure if this question is qualified to be asked here. It's my desire to find the rules in the CSS spec, which I failed to, that are responsible for the effect that I describe bellow. So I feel it's somewhat spec-related. Hope it's OK to ask here.

Example: http://jsbin.com/ocadip/1/edit

By putting a relatively positioned box inside an absolutely positioned box, I was able to horizontally center a box that has a variable width, but this method failed to work vertically. All major browsers I tested refuse to center it vertically.

I have gone through the CSS2.1 spec multiple times, but couldn't find the responsible rules. Since all major browsers behave consistently on this one, I'm pretty sure I missed some rules. I'm wondering which ones.

Thanks for the help.


Received on Saturday, 22 June 2013 12:12:15 UTC

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:08:31 UTC