percentage values for top and bottom on relatively positioned element not honored when parent has auto height

RESOLVED DUPLICATE of bug 260348

Status

()

Core
Layout
RESOLVED DUPLICATE of bug 260348
4 years ago
4 years ago

People

(Reporter: Louis Lazaris, Unassigned)

Tracking

25 Branch
x86_64
Windows 7
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

4 years ago
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%.
Confirming. Though - as noted - MSIE 11/Chrome behave as Gecko/Firefox.
FWIW, it works with "position: absolute;" set.
Component: Untriaged → Layout
Product: Firefox → Core
Status: UNCONFIRMED → RESOLVED
Last Resolved: 4 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
Duplicate of bug: 260348
You need to log in before you can comment on or make changes to this bug.