问题描述:

I'm using white-space: pre-wrap to allow user input to include arbitrary whitespace and have it faithfully reproduced in the output.

However, I feel that the space between paragraphs of text is too big.

Is there any way to specify... I don't know, something like line-height, but only for empty lines?

If not, the text is already being parsed for colour codes, so I suppose I could expand the parser to look for paragraphs and wrap them in <p> tags instead. That'd work. I'm just wondering if there's a pure CSS solution.

网友答案:

You cannot select an empty line out of a multiline paragraph in CSS only.

You can select empty elements. But I would go with your suggestion to use p tags.

相关阅读:
Top