Domanda

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

È stato utile?

Soluzione

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.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top