Create or add a viewport meta tag.
Arguments
- .meta
A
meta
object created bymeta()
oras_meta()
, or returned by ameta_*()
object.- width
Sets the width of initial viewport.
width
setsmin_width
andmax_width
and may contain two values; for example, the following are equivalent:"300px 500px"
orc("300px", "500px")
). The values may be a number with units, a percentage, or"device-width"
. Pixels are assumed if no units are provided.- initial_scale
Initial scale
- orientation
One of
"auto"
,"portrait"
,"landscape"
.- min_width, max_width
Minimum and maximum initial viewport width. See
width
for more information.width
is ignored ifmin_width
ormax_width
are set.- height, min_height, max_height
Sets height of initial viewport. Follows the same conventions as
width
,min_width
, andmax_width
.- minimum_scale
Minimum scale
- maximum_scale
Maximum scale
- user_scalable
User scalable
- ...
Additional name/value pairs
Value
A meta
object, or a set of <meta>
HTML tags inside an HTML
<head>
tag. For use in rmarkdown::html_document()
, shiny::runApp()
,
or other HTML locations.
See also
Other meta:
meta_apple_itunes_app()
,
meta_apple_web_app()
,
meta_general()
,
meta_geo()
,
meta_google_scholar()
,
meta_name()
,
meta_social()
,
meta_tag()
,
meta()
Examples
meta() %>%
meta_viewport()
#> <meta name="viewport" content="width=device-width, initial-scale=1, orientation=auto"/>
meta() %>%
meta_viewport(orientation = NULL)
#> <meta name="viewport" content="width=device-width, initial-scale=1"/>
meta() %>%
meta_viewport(maximum_scale = 1)
#> <meta name="viewport" content="width=device-width, initial-scale=1, orientation=auto, maximum-scale=1"/>