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