HTML rows Attribute
Description
The rows attribute in HTML is primarily used in the context of a <textarea> element. This attribute specifies the visible height of a text area, determining the number of lines that will be visible to the user without needing to scroll. It accepts a numerical value that represents the number of text lines. By adjusting the rows attribute, developers can control the text area's vertical size, making it more suitable for its intended use, whether for a short comment box or a larger text editing area. For instance, setting rows="4" makes the text area four lines tall. It's important to note that while the rows attribute helps define the initial size of the text area, users can typically resize it in their browser unless the resizing feature is explicitly disabled with CSS.
Syntax
<textarea rows="number">
Values
- numberA number that specifies the rows of a textarea.
Applies To
Example
Browser Support
The following information will show you the current browser support for the HTML rows attribute. Hover over a browser icon to see the version that first introduced support for this HTML attribute.
This attribute is supported by all modern browsers.
Desktop
Tablets & Mobile
Last updated by CSSPortal on: 29th March 2024
