如何渲染多行文本组件,行与行之间有白色间隙,但有display:inline-block
个属性?我有一个带有多行文本的code
标记,它应该有属性DISPLAY:INLINE-BLOCK.我被告知不要更改内容或显示属性,而是要在行之间留出一定的间距,这样背景色属性就只影响一行.是否可以使用Display:Inline-BLOCK?
我发现了非常接近的问题How to render multi-line Text component with white gap between lines,但那里的示例适用于Display:Inline. 以上是我想要得到的:
code {
background-color: aqua;
line-height: 1.5;
}
<code>It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using 'Content here, content here', making it look like readable English. Many desktop publishing packages and web page editors now use Lorem Ipsum as their default model text, and a search for 'lorem ipsum' will uncover many web sites still in their infancy. Various versions have evolved over the years, sometimes by accident, sometimes on purpose (injected humor and the like).</code>