label,
textarea {
  font-size: 0.8rem;
  letter-spacing: 1px;
}

textarea {
  padding: 10px;
  max-width: 100%;
  line-height: 1.5;
  border-radius: 5px;
  border: 1px solid #ccc;
  box-shadow: 1px 1px 1px #999;
}

label {
  display: block;
  margin-bottom: 10px;
}

The above example demonstrates a number of features of

css
textarea {
  max-height: 130px;
  max-width: 500px;
}

Result

Example using "minlength" and "maxlength"

This example has a minimum and maximum number of characters — of 10 and 20 respectively. Try it and see.

html

css
textarea {
  max-height: 130px;
  max-width: 500px;
}

Result

Note that minlength doesn't stop the user from removing characters so that the number entered goes past the minimum, but it does make the value entered into the

css
textarea {
  max-height: 130px;
  max-width: 500px;
}

Result

Note: Placeholders should only be used to show an example of the type of data that should be entered into a form; they are not a substitute for a proper element tied to the input. See labels for a full explanation.

Disabled and readonly text areas

This example shows two

css
textarea {
  display: block;
  resize: horizontal;
  max-width: 500px;
}

Result

Technical summary

Content categories Flow content, phrasing content, Interactive content, listed, labelable, resettable, and submittable form-associated element.
Permitted content Text
Tag omission None, both the starting and ending tag are mandatory.
Permitted parents Any element that accepts phrasing content.
Implicit ARIA role textbox
Permitted ARIA roles No role permitted
DOM interface HTMLTextAreaElement

Specifications

Specification
HTML
# the-textarea-element

Browser compatibility

See also