문제

I'll tell you what I would do

I have to create a simple div with width: 100%

Inside I put text centered (vertically and horizontally)

I would like the text inside the div auto-amended the font size according to the size of the div

I hope I was clear

Thanks to all

도움이 되었습니까?

해결책

Similar things have been asked around here. I myself had needed that once, and found no way of doing that accuarately with CSS only.

I ended up having a Javascript function that took each div and an inner paragraph with a predetermined font-size and reduced its font size until the paragraph had less width and height than its parent div.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top