Relates to root element (HTML element) font size.
Ex: 2 rem = root element (HTML element) font size * 2
Example: Apply rem unit to font size and line height properties of the DIV elements.
<!DOCTYPE html>
<html>
<head>
<title> CSS rem unit </title>
<style>
html {
font-size:25px;
}
div {
font-size: 2rem;
line-height: 4rem;
border: 1px solid green;
}
</style>
</head>
<body>
<div >
First Line (Parent)
<div> Second line (Child) </div>
</div>
<div> Third line</div>
</body>
</html>
Result:
In the above example,