Home
CSS
CSS Units
Tryit: Using percentage
Run ❯
Get your
own
website
Result Size:
625 x 534
×
Change Orientation
Save Code
Change Theme, Dark/Light
Go to Spaces
<!DOCTYPE html> <html> <head> <style> body { font-size:16px; } div { font-size: 150%; border: 1px solid black; } </style> </head> <body> <p>The font-size of this document is 16px.</p> <div>The font-size of this div element is 150%.</div> <p>The % unit sets the font-size relative to the current font-size.</p> </body> </html>