Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to add horizontal padding to every line in one multi-line wrapped sentence?

Tags:

html

css

This is my code:

<div><p><span>... highlighted text ...</span></p><p>Chapter info</p></div>

This is what it currently looks like:

http://i48.tinypic.com/2dqvo1i.png

Is there a way to add padding to the sides of the highlighted text? Regular padding on the SPAN doesn't work, because it only takes into account the the beginning and end of the sentence, not every line separately.

Any ideas? CSS3 code is fine.

like image 883
Marc Avatar asked Jun 22 '10 20:06

Marc


1 Answers

A simple way is to add this to your style sector definitions:

span {
padding-left: 8px;
padding-right: 8px;
}

Also it works for "p" (and for others) instead of "span".

like image 92
Pablo Manera Avatar answered Sep 23 '22 16:09

Pablo Manera