Possible Duplicate:
Auto-size dynamic text to fill fixed size container.
Let’s say i have a div that is 600 px high and 400 px wide. I want my text in the middle of this, and to span the entire width of the div. Is there something in CSS or CSS3 that will let me auto do this based on how much text a user inputs?
so, the word FOO would be larger than the word FOOBAR as foobar would take up more space, thus dynamically resizing that text.
Just wondering; I’m not sure if it’s possible (would be acceptable to have a JS solution too..)
Thank you!
One solution I can think is:
Let says the max size you can have by just typing word
FOOin box is200pxSo create a new hidden div set a fixed width of 600 but not height, then loop through
hidden divwidth 600and leave the heightloopthrough javascript by reducing the font-sizeuntil the height is <= 400