C
C
Cyril2016-11-30 20:57:32
css
Cyril, 2016-11-30 20:57:32

How to increase the font size in proportion to the block size?

There is some block div . It has some 16px text.
What is the correct way to use percentages instead of pixels in font size? We want the text to grow proportionately as the (height and width) of the div increases .

Answer the question

In order to leave comments, you need to log in

3 answer(s)
W
WQP, 2016-11-30
@WQP

https://www.smashingmagazine.com/2016/05/fluid-type...

R
Rafael™, 2016-11-30
@maxminimus

1) increase the block through transform: scale() then everything in it will proportionally increase
2) in js, track the size of the block and change the font size as needed

T
trushka, 2016-12-01
@trushka

3) You can set the block sizes in em and change the font size - then the block sizes will also change proportionally..

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question