Elements styled with height:x% do not resize at all

VERIFIED INVALID

Status

()

P3
normal
VERIFIED INVALID
19 years ago
19 years ago

People

(Reporter: keith.lesch, Assigned: pierre)

Tracking

Trunk
x86
Windows NT
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: testcases)

Attachments

(2 attachments)

(Reporter)

Description

19 years ago
The following attachment will show 5 elements, the DIV, INPUT, TEXTAREA, SELECT 
MULTIPLE, and BUTTON.  Each element should take up 20% of the height of the 
page, but none of them do.
(Reporter)

Comment 1

19 years ago
Created attachment 4873 [details]
Elements do not resize according to height.
(Reporter)

Comment 2

19 years ago
Created attachment 4875 [details]
Test inside a table as well: this presented new probs w/width.
(Reporter)

Updated

19 years ago
Whiteboard: testcases
(Assignee)

Comment 3

19 years ago
This is the usual Initial Containing Block problem. The default height for an 
element is 'auto' and 20% of 'auto' still makes 'auto'. If you want the elements 
to have a height of 20% of the viewport, you have to specify it:
    <style>
      html {height:100%;}
      body {height:100%;}
      form {height:100%;}
    </style>

Note that the requirement of "height: 100%" on the html element is a gray area in 
the spec. We may adopt a more lax interpretation like IE's where the default size 
of html element matches the viewport. For the rest, Moz is correct. IE embraces, 
extends... and you know where that leads.

The second testcase, even with the additional style above, reveals another 
instance of bug 915. I copied it over there.

Closed as Invalid (but thanks for the excellent bug report).
Status: NEW → RESOLVED
Last Resolved: 19 years ago
Resolution: --- → INVALID

Comment 4

19 years ago
Verified invalid
Status: RESOLVED → VERIFIED
(Reporter)

Comment 5

19 years ago
Sorry, I always forget to come in here and verify.  Thank you for the 
explanation of my bad assumptions of what should happen...I totally agree that 
Mozilla should stick to this pattern with heights, as I already know strange 
(and ugly) things happen in IE when you're using percentage heights and 
something is forced out of the viewport.
You need to log in before you can comment on or make changes to this bug.