Show Output
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>CSS Font Scaling Based on Width of the Container</title> <style> h1{ font-size: 2em; /* fallback value */ font-size: 6vw; } </style> </head> <body> <h1>This is a Responsive Heading</h1> <p><strong>Note:</strong> Open the output in a new blank tab (Click the arrow next to "Show Output" button) and resize the browser window to understand how font scaling actually works.</p> </body> </html>