I'm trying to achieve this kind of effect
Basically, I want the background for my heading to span across the available space, but not under the text. The problem is that this needs to be dynamic as the text can be in multiple languages. I can't simply put another background in a separate span for the text, since the overall background used a pattern image, and it can't just randomly start and stop depending on the length of the text.
I hope i made myself clear enough!
EDIT: since the example was not clear enough, here is another one: