Reputation: 583
I have an input field:
<input type="text" id="TextField" />
and set it to resize:
#TextField {
resize: horizontal;
}
But it does not resize.
How can I have a text field resize horizontally (not vertically) when the text nears the end (right) of the text field? Or, are there any built-in ways for this to work (maybe using something in CSS)?
Upvotes: 0
Views: 4144
Reputation: 3649
BTW there's a plugin which can help you achieve what you are looking for Resize INput box
Upvotes: 1
Reputation: 967
You will need to calculate the width of the box based on the width of the text. Here is a simalar question that might help. Calculate text width with JavaScript
Upvotes: 3