sudhakarinfotech
(current)
Run Code
Live Code Editor- CSS Relative Units
Source Code
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <title>CSS Units</title> <style type="text/css"> #topParaContent { font-size: 2.5em; /* 40px/16=2.5em */ } #secondParaContent { font-size: 1.875em; /* 30px/16=1.875em */ } #thirdParaContent { font-size: 0.875em; /* 14px/16=0.875em */ } </style> </head> <body> <div class="container mt-5"> <h1>CSS Unit Example</h1> <p id="topParaContent">First paragraph text content.</p> <p id="secondParaContent">Second paragraph text content</p> <p id="thirdParaContent">Third Paragraph text content.</p> </div> <!--/container--> </body> </html>
Source Code Output :
Running