html - How to add padding-left and right on each line break in a span -


this question has answer here:

html

<h1><span>lorem ipsum<br>dolor si amet<br>etc etc etc</span></h1> 

css

h1{color:#fff;line-height:48px;} h1 span{background:#000; color:#fff; padding:5px 10px;} 

fiddle

i add padding left , right on each line. picture

enter image description here

but can't find solution. note text can edited client don't know line break be.

<h1>     <span>lorem ipsum</span><br/>     <span>dolor si amet</span><br/>     <span>etc etc etc</span> </h1> 

here fiddle


Comments