CSS - Measurement Units



Example -Demo vmin unit

<!DOCTYPE html>
<html>
<head>
  <style>
    .box {
      width: 100%;
      height: 100vh;
      display: flex;
      justify-content: center;
      align-items: center;
    }
    
    .text {
      font-size: 2vmin;
      margin-bottom: 20px;
    }
    
    .text-2 {
      font-size: 4vmin;
      margin-bottom: 20px;
    }
    
    .text-3 {
      font-size: 6vmin;
    }
  </style>
</head>
<body>
  <div class="box">
    <div class="text">This is a text with font-size of 2vmin.</div>
    <div class="text-2">This is a text with font-size of 4vmin.</div>
    <div class="text-3">This is a text with font-size of 6vmin.</div>
  </div>
</body>
</html>
Advertisements