Skip to content

[css-position-3] Blockified absolutely-positioned inline elements #2369

@litherum

Description

@litherum

Consider the following:

<div>Hello <span style="position: absolute; width: 20px; height: 20px; background: red;"></span>World</div>

In all browsers, this is rendered by putting the red square's block-start and inline-start coordinate at the spot in the text where it would have appeared had it been position: static.

screen shot 2018-02-27 at 11 08 27 pm

According to CSS 2.1,

the box is absolutely positioned, the computed value of 'float' is 'none', and display is set according to the table below. The position of the box will be determined by the 'top', 'right', 'bottom' and 'left' properties and the box's containing block.

However, I couldn't find any text about setting the 'top', 'right', 'bottom' or 'left' properties in this situation.

Even worse, css-position-3 seems to say this situation shouldn't blockify:

  • Rule 1 doesn't apply because display isn't none.
  • Rule 2 doesn't apply because the value of float isn't left or right.
  • Rule 3 doesn't apply because float is none.
  • Rule 4 doesn't apply because the element is not the root element.
  • Rule 5 says nothing about blockifying.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions