×

Save Your Code

If you click the save button, your code will be saved, and you get an URL you can share with others.

By clicking the "Save" button you agree to our terms and conditions.

Report Error

×

Save to Google Drive

If you have a Google account, you can save this code to your Google Drive.

Google will ask you to confirm Google Drive access.

×

Open from Google Drive

If you have saved a file to Google Drive, you can open it here:

Result Size: 625 x 571
x
 
<!DOCTYPE html>
<html>
<head>
<style>
html {
  font-size:16px;
}
div {
  font-size: 3rem;
  border: 1px solid black;
}
#top-div {
  font-size: 2rem;
  border: 1px solid red;
}
</style>
</head>
<body>
<p>The font-size of this document is 16px.</p>
<div id="top-div">
The font-size of this div element is 2rem, which translates to 2 x the browser's font size.
<div>The font-size of this div element is 3rem. It also shows that it does not inherit from its parent element font size.</div>
</div>
<p>The rem unit sets the font-size relative to the browsers base font-size, and will not inherit from its parents.</p>
</body>
<!-- Mirrored from www.w3schools.com/cssref/tryit.asp?filename=trycss_unit_rem by HTTrack Website Copier/3.x [XR&CO'2014], Mon, 27 Jan 2020 02:35:40 GMT -->
</html>
×

Report a Problem: