Closed
Bug 12962
Opened 26 years ago
Closed 25 years ago
left: auto on block strange after inline (absolute positioning)
Categories
(Core :: Layout, defect, P3)
Core
Layout
Tracking
()
VERIFIED
FIXED
M17
People
(Reporter: dbaron, Assigned: troy)
Details
(Keywords: css2)
Attachments
(1 file)
471 bytes,
text/html
|
Details |
DESCRIPTION: When a block level element that is positioned absolutely follows
an inline element, left:auto finds the end of the inline element rather than
where the block would begin on a new line. While this isn't noncompliant with
any specs (CSS2), it's a bit strange.
STEPS TO REPRODUCE: Load attached test case.
ACTUAL RESULTS: The green box has its left edge even with the right end of the
text before it.
EXPECTED RESULTS: It should be even with the left end (beginning) of the text
before it.
DOES NOT WORK CORRECTLY ON:
* Linux, viewer, 1999-08-30-01-M10
Reporter | ||
Comment 1•26 years ago
|
||
Reporter | ||
Comment 2•26 years ago
|
||
Dare I add...
WORKS CORRECTLY ON:
* Nav 4.6 Linux.
Isn't this the very same issue I raised in bug #12302?
I think the issue here is that the spec is unclear when referring to the
"hypothetical box". Note that IE5 does it differently as well.
Reporter | ||
Comment 4•26 years ago
|
||
There you were asking whether an element with display: inline should be treated
for this purpose as if it were a block. That's not unreasonable.
This bug is that a block level element is being treated as if it were inline.
That makes much less sense.
No, one of the questions was about a positioned block-level element that follows
an inline. Here's the example attachment I provided. Isn't that the same?
<html>
<head>
<style>
#outofflow {
position: absolute;
top: auto;
left: auto;
width: auto;
height: 100px;
border: solid 2px red;
}
</style>
</head>
<body>Text <div id="outofflow">Out-of-flow text</div> more text</body>
</html>
Updated•26 years ago
|
QA Contact: petersen → chrisd
Updated•26 years ago
|
Summary: left: auto strange after inline → {css2} left: auto on block strange after inline
Comment 6•26 years ago
|
||
I agree with David, it would make more sense if left:auto on a block box
following an inline positioned it in the same place as it would if it was not
positioned. That is the spirit of the spec, after all.
If the author wants the effect you are doing, then they should use
display:inline and position it with 'left:auto; top:auto; margin-top:2em'.
Otherwise, there is no difference whatever the original value of 'display'.
Note that AFAICT, you are actually using the "as if we were a block" position
for the 'top:auto', but the "as if we were an inline" for the 'left:auto'.
I think here you want to make sure both are using the same principles. At least
IE5 is consistent in where it puts it's block (it acts as if it was an inline,
which IMHO is wrong).
This issue was discussed at the W3C face to face and it was agreed that
"hypothetical box" means exactly where the element would have been positioned
and sized had it been in the flow
Comment 8•25 years ago
|
||
Migrating from {css2} to css2 keyword. The {css1}, {css2}, {css3} and {css-moz}
radars should now be considered deprecated in favour of keywords.
I am *really* sorry about the spam...
Updated•25 years ago
|
Summary: {css2} left: auto on block strange after inline → left: auto on block strange after inline
Comment 9•25 years ago
|
||
[adding 'absolute' to the summary line to ease searching]
Summary: left: auto on block strange after inline → left: auto on block strange after inline (absolute positioning)
Assignee | ||
Comment 10•25 years ago
|
||
The new absolute positioning code does a much better job or calculating where
the element would have been if it had been in the flow
Now we pay attention to the fact it would have been a block and recognize it
would have been on a new line
Status: ASSIGNED → RESOLVED
Closed: 25 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•