Learn R Programming

yonder (version 0.2.0)

float: Float

Description

Use float() to float an element to the left or right side of its parent element. A newspaper layout is a classic usage where an image is floated with text wrapped around.

Usage

float(tag, side)

Arguments

tag

A tag element.

side

A responsive argument. One of "left" or "right" specifying the side to float the element.

See Also

Other design utilities: active(), affix(), background(), border(), display(), font(), height(), padding(), scroll(), shadow(), width()

Examples

Run this code
# NOT RUN {
### Newspaper layout

div(
  div() %>%
    width(5) %>%
    height(5) %>%
    margin(right = 2) %>%
    background("amber") %>%
    float("left"),
  p(
    "Fusce commodo. Nullam tempus. Nunc rutrum turpis sed pede.",
    "Phasellus lacus.  Cras placerat accumsan nulla.",
    "Fusce sagittis, libero non molestie mollis, ",
    "magna orci ultrices dolor, at vulputate neque nulla lacinia eros."
  ),
  p(
    "Nulla facilisis, risus a rhoncus fermentum, tellus tellus",
    "lacinia purus, et dictum nunc justo sit amet elit."
  ),
  p(
    "Proin neque massa, cursus ut, gravida ut, lobortis eget, lacus.",
    "Aliquam posuere.",
    "Sed id ligula quis est convallis tempor."
  )
)

# }

Run the code above in your browser using DataLab