Saturday, May 18, 2024
HomeSoftware DevelopmentAutoGrow Textareas with CSS

AutoGrow Textareas with CSS


Because the calls for of the net change and builders experiment with totally different consumer experiences, the necessity for extra native language enhancements expands. Our presentation layer, CSS, has finished extremely properly in bettering capabilities, even when generally too sluggish. The necessity for native help for robotically increasing textarea components has been lengthy recognized…and it is lastly right here!

To permit textarea components to develop vertically and horizontally, add the field-sizing property with a worth of content material:

textarea {
  field-sizing: content material; // default is `fastened`
}

The default worth for field-sizing is fastened, signaling present conduct. The brand new conduct, content material, will develop as a lot as attainable. To constrain the scale a textarea can develop, use conventional width/max-width and peak/max-height properties.

  • Interview with a Pornhub Web Developer
  • Detect DOM Node Insertions with JavaScript and CSS Animations

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments