Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

line-height textarea

Tags:

html

textarea

Currently, my textarea is displayed like this: click here to see the picture.

I would like that height between each lines be less important.

UPDATE:

I tried line-height in the css file:

textarea{ line-height: 120%; }

but it doesn't work, just reduces the textarea height and doesn't reduce the height between lines.

How can I do it?

like image 886
Zozo Zozo Avatar asked Aug 23 '12 05:08

Zozo Zozo


People also ask

How do you use line height?

The line-height CSS property sets the height of a line box. It's commonly used to set the distance between lines of text. On block-level elements, it specifies the minimum height of line boxes within the element. On non-replaced inline elements, it specifies the height that is used to calculate line box height.

How line height is calculated?

Sets line height to be equal to a multiple of the font size. If your font size is 10px, your line height will be 10px, 18px, and 20px, respectively. Sets line height as a percentage of the font size of the element. If your font size is 10px, your line height will be 3px, 5px, and 11px respectively.

What is normal line height?

Body text (your normal paragraph text) should have a line-height of 1.4–1.6, give or take.


1 Answers

You may try percentage, em, px etc. and choose one for you. Some browsers like firefox have some errors with this.

Here is a working live demo.

like image 128
Alfred Avatar answered Nov 15 '22 08:11

Alfred