M
M
maashaa2010-09-13 11:09:54
JavaScript
maashaa, 2010-09-13 11:09:54

How to scale the font so that it takes up the entire block?

The success of a light startup on Habré You are a super feat for me to dig in the direction of my mood enhancer on Sunday evening (IE users, sorry).

It only works at 1280x1024 and uses a magic code to calculate the font size centered.style.fontSize = (900 - 3 * message.length) + '%';. At the same time, there are still problems if someone uses + "+".

And how would I make the font size fit to fill the div? Maybe you can adaptively increase it and somehow calculate the size of the resulting block?

Upd. I had to figure it out myself. The link works...

Answer the question

In order to leave comments, you need to log in

1 answer(s)
L
lugansk, 2010-09-14
@maashaa

"Quick and dirty" solution:
pastebin.com/N8N4iN79
(hung changing the font size on page load, resizing the window and entering text)
It slows down, but you can bring it to mind if you wish.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question