Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSS

how to make font size change with width and height

/*x = 100vw - 2 * 3em = 100vw - 6em
r = 224px/24px = 9.333... = 28 / 3

y = x / r
  = (100vw - 6em) / (28 / 3)
  = (100vw - 6em) * 3 / 28
  = (300vw - 18em) / 28
  = (75vw - 4.5rem) / 7*/
font-size: calc((75vw - 4.5rem) / 7)
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #font #size #change #width #height
ADD COMMENT
Topic
Name
3+4 =