The goal is to have several lines in an HTML textarea that keep the line-height (e.g. 100%). However, when using enter and going to the next line, there should be a padding.
The suggestion to use line-height:20px; will have an effect on all lines. However, I need only a padding after a line break.
line-height:20px;
JSFiddle https://jsfiddle.net/9bsu74fw/ ← It does apply the line-height to all lines. Not just the line break.
What is needed:
How to achieve this with CSS?
You can use ::first-line pseudo selector to apply style on first line only
::first-line
textarea::first-line { line-height: 20px; }
2.1m questions
2.1m answers
60 comments
57.0k users