我有一段文本,我需要为各个行提供背景颜色,中间有空格。
我已经部分实现了这一点
<div class="styleText">
<span class="spaced">Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.</span>
</div>
.
.styleText .spaced{
background: rgba(0,0,0,6.5);
line-height: 1.2em;
/*width: 421px;*/
}
但是,我需要所有行的宽度相同,并且希望在每行的开头和结尾以及顶部和底部进行填充。
任何人都可以想出一种方法来实现这种效果,还是我唯一的选择是对 styleText 类使用一些背景图像技巧?