Relatively position an element without it taking up space in document flow

后端 未结 6 1067
迷失自我
迷失自我 2020-12-04 06:02

How can I relatively position an element, and have it not take up space in the document flow?

6条回答
  •  醉梦人生
    2020-12-04 06:30

    @Bekim Bacaj had the perfect answer for me, even though it may not be exactly what the OP was looking for (although his question leaves room for interpretation). That being said, Bekim didn't provide an example.

    Beneath this...

    Stuff and Things!

    but, top = same as this paragraph.

    The example above sets up an element that...

    • uses pure and simple CSS and nothing else
    • is vertically positioned as if it was in the flow (default top setting)
    • is horizontally positioned at the right edge of the page (right: 0)
    • does not take up any space, yet will move naturally as the page scrolls (position: absolute)

提交回复
热议问题