In this tutorial I will show you how to make HTML textarea element fixed size.
This simple CSS code disables resizing of the element.
textarea {
resize: none;
}
resize: none;
}
Now you can use height and width property to provide a fixed height and width to the element. Some developers also use cols and rows css property to provide textarea size.
textarea {
width: 100px;
height: 100px;
}
width: 100px;
height: 100px;
}
You can also decide to resize your textareas only horizontal or vertical, this way:
textarea {
resize: vertical;
}
textarea {
resize: horizontal;
}
resize: vertical;
}
textarea {
resize: horizontal;
}