Connecting Tech Pros Worldwide Help | Site Map

Opera 9.5 bug, nested absolute positioning broken

  #1  
Old June 30th, 2008, 05:25 AM
Nik Coughlin
Guest
 
Posts: n/a
If you have an absolutely positioned element and you place an absolutely
positioned child element within it and give the child values for both top
and bottom the child will have zero height (expected behavior is has same
height as parent less top + bottom):

http://nrkn.com/opera9Bug/min/

How to reproduce:

Create a block element with position relative. Let's call it grandparent.
Put some text in it so that it has non-zero height

Create a block element inside grandparent with position absolute. Let's
call it parent.
Set parent to have top: 0; bottom: 0; left: 0; right: 0;*

Create a block element inside parent with position absolute. Let's call it
child.
Set child to have top: 0; bottom: 0; width: 1em; border: 1px dotted red;

In Opera 9.5 child has zero height. In all other browsers tested** child
has the same height as parent less top + bottom, which in this case as top
and bottom are 0 means the same height as parent.

*or width: 100%; height: 100%; or probably anything else for that matter
**IE7, IE8, FF2, FF3, Safari, Opera 9.27

Closed Thread


Similar Threads
Thread Thread Starter Forum Replies Last Post
Need help finding CSS bug in Opera rhino answers 15 June 27th, 2008 08:19 PM