HTML Expand To Fit

September 6th, 2012
html, tech
If I have a block of text that I want to expand to fill the screen, there ought to be some way to specify this in HTML. Specifically, I want to put contra dance calling cards on my phone [1]. I definitely don't want any scrolling, and I'd like them to be as big as possible. I've figured out a hackish way to do this with javascript, but there ought to be a clean way. The hackish way:
Draft: Trip To Lambertville
This runs a little loop:
  make font huge
  while vertical scroll bar present:
    make font a little smaller
While this works, I really ought to be able to ask the browser nicely "make this as big as will fit" instead of forcing it to do something so stupid [2]. Is this possible with just html and css?


[1] To replace the tiny illegible index cards in my wallet.

[2] Yes, I could use binary search. O(n) → O(log(n)). Still stupid.

Comment via: google plus, facebook

Recent posts on blogs I like:

Your Fave Is Problematic Politics

In favor of liking things, especially if the thing is Kamala Harris

via Thing of Things October 18, 2024

Inner dialogue, walking down the sidewalk

A discussion I have with myself a lot The post Inner dialogue, walking down the sidewalk appeared first on Otherwise.

via Otherwise October 10, 2024

Startup advice targeting low and middle income countries

This post was inspired by a week of working from Ambitious Impact’s office in London, and chatting with several of the startup charities there. While my experience is in the for-profit world, I think it’s applicable to entrepreneurs working on impact-driv…

via Home September 27, 2024

more     (via openring)