Closed
Bug 60535
Opened 24 years ago
Closed 24 years ago
CSS-P absolute positioning vertical offset
Categories
(Core :: Layout, defect, P3)
Tracking
()
RESOLVED
INVALID
People
(Reporter: raubeno, Assigned: clayton)
References
()
Details
Attachments
(3 files)
While designing a page for class I discovered that absolute positioning of elements is miscalulated. Everything that is absolute positioned within another absolute positioned block container is shifted 16px down from where it should be.
Comment 1•24 years ago
|
||
makingtest
Comment 2•24 years ago
|
||
Comment 3•24 years ago
|
||
testcase
Comment 4•24 years ago
|
||
confirming -- I see this with linux trunk build 2000-11-17-08. Is this a regression? I believe absolute positioning used to work...
Status: UNCONFIRMED → NEW
Ever confirmed: true
Reporter | ||
Comment 5•24 years ago
|
||
Reporter | ||
Comment 6•24 years ago
|
||
Reporter | ||
Comment 7•24 years ago
|
||
Absolute positioning does work for DIV, but not for P and H*. The offset for P and H* is fine normally and indeed expected. However, with ablsolute positioning it should be toggled off. I would expect the offset problem may exist with tables as well, but I haven't tested it.
Comment 8•24 years ago
|
||
Doh. The problem here is that the P and H* elements have nonzero margins! And absolute positioning specifies the position of the whole box (content, padding, border, margins), not of the content. If I set the margin on P to zero on the original testcase (or if I do the same to H3 in Ben's testcase) the layout is exactly the same as for divs. I should have caught this earlier.... Marking invalid, since this is the correct CSS2 behavior.
Status: NEW → RESOLVED
Closed: 24 years ago
Resolution: --- → INVALID
Reporter | ||
Comment 9•24 years ago
|
||
Boris is right the margins are the problem. However, this just means there is a different bug. My understanding is the there should never be a non-zero default for margins. http://www.w3.org/TR/REC-CSS2/box.html#margin-properties Please correct me if I'm wrong. IE 5.5 renders the initial test case correctly with 0 margins as the default.
Comment 10•24 years ago
|
||
All that says is that unless the margins are set by a stylesheet they should be 0. In this case the margins are set by the user-agent stylesheet for HTML 4.0. If you look at the W3C's recommended HTML 4.0 stylesheet (http://www.w3.org/TR/REC-CSS2/sample.html), you will see that quite a number of elements have recommended margins. Unfortunately, the choice of a user-agent stylesheet is up to the useragent. So you really can't depend on the initial values of things like margins and should set them yourself if you really care about precise positioning....
Reporter | ||
Comment 11•24 years ago
|
||
I stand corrected. Thank you. Case closed.
Comment 12•22 years ago
|
||
*** Bug 119342 has been marked as a duplicate of this bug. ***
You need to log in
before you can comment on or make changes to this bug.
Description
•