Answers for "font size calc responsive"

CSS
1

css calc font size

/*Here a possible solution:*/

http://codepen.io/CrocoDillon/pen/fBJxu

p {
  margin: 0;
  font-size: calc(4vw + 4vh + 2vmin);
  /* See:
   * http://codepen.io/CrocoDillon/pen/jgmwt
   * For some math behind this
   */
}
/*Font-size is calculated with available size using a function that is not 
perfect, but may be adjusted to work well in some cases.*/
Posted by: Guest on July-28-2020
6

responsive font-size

/* please refer to https://developer.mozilla.org/fr/docs/Web/CSS/clamp() */
font-size: clamp(40px, 10vw, 70px); /* clamp(MIN, VAL, MAX) */
Posted by: Guest on December-09-2020

Browse Popular Code Answers by Language