rem unit
The rem relative unit of measurement
sets a font size of the element depending on
the font of the root element - <html>. For
example, a font equal to 2rem means that
it is twice the size of the root element.
Example
Let's set the heading text font one
and a half times larger than the root
element font, and 1rem to the
paragraph:
<h1>Text1</h1>
<p>text2</p>
body{
font-size: 14px;
}
h1 {
font-size: 1.5rem;
}
p {
font-size: 1em;
}
:
See also
-
the
pxunit
that specifies a size in pixels -
the
frunit
that specifies a size in fr -
the
emunit
that specifies a size in em -
the
%unit
that specifies a size in percentage -
the
vwunit
that specifies a size in vw -
the
vhunit
that specifies a size in vh -
the
vmaxunit
that specifies a size in vmax -
the
vminunit
that specifies a size in vmin