当前位置: 动力学知识库 > 问答 > 编程问答 >

css - Bring preformatted paragraphs closer together?

问题描述:

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.

分享给朋友:
您可能感兴趣的文章:
随机阅读: