Show Output
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>Defining Font Size Using REM</title> <style> html { font-size: 62.5%; /* font-size 1em = 10px */ } body { font-size: 1.6rem; /* 1.6rem = 16px */ } p { font-size: 1.4rem; /* 1.4rem = 14px */ } p span { font-size: 2rem; /* 2rem = 20px (not 28px) */ } </style> </head> <body> <h1>This is a heading</h1> <p>This is a <span>paragraph</span>.</p> </body> </html>