ttmt — 2013-07-04T15:04:56-04:00 — #1
I have a demo here to illustrate
Is it possible to have a 100% text size so it fills the available space and then change size with the <p> if the window is resized.
In my demo the text in paragraph two is set to fill the paragraph by trail and error and if the window is resized the text wraps.
dresden_phoenix — 2013-07-04T17:14:16-04:00 — #2
Grumpy cat says "NO!" ( at least with pure CSS)
So I take what you are trying to do is 'copyfit' on the web. Think of it this way: in CSS the content determines the size of the container, but not the other way around. This would be no different in text ( which essentially is an anonymous content shell that by definition cannot contain anything itself) . BESIDES the biggest sin in web design is to take control of text size from the viewer.
Am afraid thsi just not possible with plain CSS, nor is it something that would be considered as a property n future CSS.
Than begin said .js can do it in convoluted ways (ON WINDOW RE SIZE: counting characters, and obtaining container size, then setting the CSS ..etc) and keep in mind that this wont be perfect either as not all letters are the same size anyway ( you always need humans for true copy fitting)
cletusspuckler — 2013-07-05T08:26:13-04:00 — #3
Check out for instance http://fittextjs.com/