Skip to content

unexpected overflow with display:inline-block + margin #9308

Closed

Description

@paulrouget

rggdhwjnub

The following example makes the body element scrollable. The extra area is apparently directly related to the margin value.

Note: using block instead of inline-block reduces the scrollable area, but it's still possible to scroll.

<div style="left: 0px; bottom: 0px; position: absolute;">
  <div style="margin: 200px; display: inline-block; background: red">foobar</div>
</div>

Activity

  1. added a commit that references this issue on Jan 23, 2016
  2. added a commit that references this issue on Jan 25, 2016
  3. pcwalton commented on Jan 27, 2016

    @pcwalton
    Contributor

    Smaller test case:

    <!DOCTYPE html>
    hello
    

    Shouldn't scroll.

    The problem goes away if margins on the document element are set to zero.

  4. added 3 commits that reference this issue on Jan 27, 2016
    0d2428c
    ce1dd57
    2332fd5
  5. added 2 commits that reference this issue on Jan 27, 2016
    fe4e7f5
    35efe7b
  6. added a commit that references this issue on Jan 28, 2016
    777c46f
  7. added 4 commits that reference this issue on Jan 28, 2016
    ae6b503
    430123f
    c8dfe16
    d1ff330
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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