It's a bit tricky to explain, so if anyone has a better title in mind, feel free to change it.
I'm trying to create a black box behind my headline. I'm using a span inside the h-tag for this purpose, but I need to add some padding to the left and right. Since my layout is responsive, the headline might wrap onto two lines.
<div class="headline-black">
<h1 class="entry-title">
<span>A very long headline that goes on and on and on.</span>
</h1>
</div>
h1 span {
background: none repeat scroll 0 0 #000000;
line-height:44px;
padding:7px 25px 8px 25px;
}
.headline-black h1 {
color: #FFFFFF;
font-size: 22px;
}
The issue: The padding only applies to the beginning and end of the span. When the headline wraps onto two lines, the letters touch the border of the box.
I hope this explanation makes sense. Here's the fiddle. Try resizing the window to see how it behaves.
http://jsfiddle.net/832u8/2/
Edit: I want the box to conform to the text, as if highlighted with a marker. But I need padding for each line.