Font-size CSS - Tryit Editor for Web Developers
Edit This Code:
See Result »
<html> <head> <style> body { font-size: 100%; } h1 { text-align: center; color: blue; font-size: 3.5em; } h2 { text-align: center; color: purple; font-size: 2.0em; } p { text-align: left; color: red; font-size: 1.5em; } </style> </head> <body> <h1>Welcome To CSS!!!</h1> <h2>Font-size with percentage and em</h2> <p>Specifying the font-size in "percent" and "em" displays the same size in all major browsers, and allows all browsers to resize the text!</p> <img src="logo.jpg"/> </body> </html>
Result: