html - One row of textarea is of how much height?

Mohammad Areeb Siddiqui picture Mohammad Areeb Siddiqui · Jul 4, 2013 · Viewed 32.5k times · Source

I want to know the height of one row of textarea. I want to know that because I want to do some calculations. Do we know it or do we have to do some scripting?

Answer

Ruben Kislaki picture Ruben Kislaki · Jul 4, 2013

The height of a row is set by line-height.

For example:

<textarea rows="1">hello world</textarea>

If you set the following:

textarea { line-height: 1; font-size: 12px; border: none; margin: 0; padding: 0; }

By inspecting the textarea element you'll find out that it has a height of 12px.