Menu

Post image 1
Post image 2
Post image 3
Post image 4
Post image 5
1 / 5
0

AutoGrow Textareas with CSS

David Walsh Blog·David Walsh·about 1 month ago
#fcqMj7nV
Reading 0:00
15s threshold

As the demands of the web change and developers experiment with different user experiences, the need for more native language improvements expands. Our presentation layer, CSS, has done incredibly well in improving capabilities, even if sometimes too slow. The need for native support for automatically expanding textarea elements has been long known...and it's finally here! To allow textarea elements to grow vertically and horizontally, add the field-sizing property with a value of content : textarea { field-sizing: content; // default is `fixed` } The default value for field-sizing is fixed , signaling current behavior. The new behavior, content , will expand as much as possible. To constrain the size a textarea can grow, use traditional width/max-width and height/max-height properties. Recent Features CSS vs. JS Animation: Which is Faster? How is it possible that JavaScript-based animation has secretly always been as fast — or faster — than CSS transitions?…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.

Read More