By shrink wrap, I mean that the element is just large enough to encompass its text contents. For example, spans shrink wrap around any text within them.
However, input type="text" and textarea elements don't. I was wondering if there was any way to make them shrink wrap.
You'd probably have to write a javascript checker that re-sets the width and height of the input after each character is written or the focus moves out of the input. You'd be hard pressed to get it working perfectly though, unless you want to spend an inordinate amount of time checking which letters are used and adjusting for their widths.
In other words, unless someone else here has a simpler solution I can't see it being worth it personally.
Bookmarks