我有一個文本塊,我需要給一個背景色,以各條線在兩者之間的空間。背景顏色爲文本。兩者之間的空間。線條寬度相同。上線填充
我已經部分地與
<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類唯一的選擇?
不,你不能這樣做,只用CSS。補白僅應用於塊級元素和你的線並不是塊肯定.. –
可你要acheive結果添加圖像?我很難理解你需要什麼 – Yisela
我已經爲你添加了一個圖像 – Fraser