Set Responsive Font Size using CSS

CSSWeb DevelopmentFront End Technology

To set the responsive font size, use the ‘viewport width’ and set it to ‘vw’ unit. You can try to run the following code to use ‘vw’ unit −

Example

Live Demo

<!DOCTYPE html>
<html>
   <head>
      <style>
         h1 {
            font-size:8vw;
         }
      </style>
   </head>
   <body>
      <h1>This is demo heading</h1>
      <p>This is demo text.</p>
   </body>
</html>
raja
Published on 08-May-2018 08:21:33
Advertisements