position: Position an element

Description Usage Arguments Examples

View source: R/position.R

Description

The position() adjusts how an element is positioned. Positioning could be absolute or relative. Furthermore, you can arrange an element within its parent element using top, right, bottom, or left.

Usage

1
2
3
4
5
6
7
8
9
position(
  x,
  value,
  top = NULL,
  right = NULL,
  bottom = NULL,
  left = NULL,
  by = "edge"
)

Arguments

x

A tag element or .style pronoun.

value

One of "static", "relative", "absolute", "fixed", or "sticky" specifying how the element is positioned.

top, right, bottom, left

One of 0, 50, or 100 specifying where the element is positioned. By default these values position an element using the element's edge, see argument by. Defaults to NULL, in which case the argument is ignored.

by

One of "" or "by-center" specifying the element's positioning anchor, defaults to "edge".

Examples

1
2
3
4
5
library(htmltools)

div(
  div(.style %>% position("absolute", t = 0, r = 0))
)

cascadess documentation built on Jan. 13, 2021, 5:10 p.m.