Skip to contents

The position_*() functions adjust set the position of an element.

Usage

position(x, method)

Arguments

x

A tag element or .style pronoun.

method

A character string specifying the positioning method. One of,

  • "static"

  • "relative"

  • "absolute"

  • "fixed"

  • "sticky"

Value

An object of the same type as x.

See also

Other position utilities: position_centered(), position_sticky()

Examples


library(htmltools)

div(
  .style %>%
    position("absolute") %>%
    position_top(50)
)
#> <div class="position-absolute top-50"></div>