Closed
Bug 939641
Opened 11 years ago
Closed 11 years ago
percentage values for top and bottom on relatively positioned element not honored when parent has auto height
Categories
(Core :: Layout, defect)
Tracking
()
RESOLVED
DUPLICATE
of bug 260348
People
(Reporter: impressive.webs, Unassigned)
Details
User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.57 Safari/537.36
Steps to reproduce:
Visit this page:
http://www.impressivewebs.com/minheight-bug.html
Or do the following:
1. Create a parent box holding a child box.
2. Give the parent a min-height value, or let the parent element expand naturally due to other content.
3. Give the child position: relative then top: 50% (or other percentage value)
Actual results:
The child box stays at the top.
Expected results:
The child box should be positioned some distance from the top (50% of the height of the parent element, in accordance with the spec).
NOTE: If you change the min-height value to a "height" value, the problem is corrected. But if you replace the min-height with content that creates natural height, the problem persists.
BROWSERS NOTE: All browsers I tested have the same behaviour (Stable Chrome, Chrome Canary, IE10, Safari 6.1) except Opera 12.16, which correctly positions the box using top: 50%.
![]() |
||
Comment 1•11 years ago
|
||
Confirming. Though - as noted - MSIE 11/Chrome behave as Gecko/Firefox.
FWIW, it works with "position: absolute;" set.
Component: Untriaged → Layout
Product: Firefox → Core
![]() |
||
Updated•11 years ago
|
Status: UNCONFIRMED → RESOLVED
Closed: 11 years ago
Resolution: --- → DUPLICATE
Summary: percentage values for top and bottom not honored when parent has min-height or no height set → percentage values for top and bottom on relatively positioned element not honored when parent has auto height
You need to log in
before you can comment on or make changes to this bug.
Description
•