Closed Bug 274810 Opened 20 years ago Closed 20 years ago

Height of absolute block includes floats

Categories

(Core :: Layout: Positioned, defect)

x86
Linux
defect
Not set
normal

Tracking

()

RESOLVED INVALID

People

(Reporter: spam_from_bugzilla, Unassigned)

Details

Attachments

(1 file)

User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.5) Gecko/20041111 Firefox/1.0 (Debian package 1.0-2)
Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.5) Gecko/20041111 Firefox/1.0 (Debian package 1.0-2)

I have a float:left block inside a postion:absolute block.  By default the
height of the absolute block seems to include the float, which isn't what I was
expecting.  If I have a float in normal flow that is taller than the containing
block it "hangs out the bottom".  For example:

<div (with border)>
  <div style="float:left">FFFFFFFF</div>
  DDDDDDDDDD
</div>

+-----------------+
|F DDDDDDDDDDDDDDD|
+F----------------+
 F
 F
 F

If the outer div is absolutely positioned the border includes the float, which
doesn't seem right:

+-----------------+
|F DDDDDDDDDDDDDDD|
|F                |
|F                |
|F                |
|F                |
+-----------------+

I've encountered this problem because I have other absolutely-positioned
elements in the space to the right of the float that don't see mouse clicks
because they are behind the transparent portion of the div.

position:fixed behaves in the same way (and this is what my real application is
using).

I will attach an example to demonstrate the problem.



Reproducible: Always

Steps to Reproduce:
This is correct according to CSS2.1.  The absolutely positioned element
establishes a new block formatting context.
Status: UNCONFIRMED → RESOLVED
Closed: 20 years ago
Resolution: --- → INVALID
Hi David,

Thanks for the quick response.  I have just found section 10.6.7 of css2.1 - I
was looking at css2 before which does not include this bit.

OK, I'll need to find some other way to make the hidden links work.

Cheers, Phil.
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: