Here is a simple trick I found out by blind luck. I wanted to prevent the textarea tag's default resizing in Chrome and Firefox. As there seems to be no attribute available for the tag such as resize="false" (Come on W3C...) I began looking for an alternative. It's actually quite easy to lock a text area using only CSS.

textarea {
  width: 250px !important;
  height: 200px !important;
}

Unfortunately the !important hack is what locks the size of the textarea. I am still looking for valid css method for sizing a textarea. Anyone else got any idea? Check out my jsfiddle for a demo! Textarea sample

« Previous Post
Pure CSS: Dynamically numbered elements
Next Post »
Why is Modernizr.load broken for the development version

Join the conversation

comments powered by Disqus