Is is possible to align a background image according to where the text ends?
Demo code:
.textBox .text { padding-top: 8px; background: url('../images/text-top.gif') left top no-repeat; padding-right:15px; }
.textBox .bottom { padding: 0px 0px 20px 15px; background: url('../images/text-bottom.gif') right bottom no-repeat; }
<div class="textBox">
<div class="text">
<div class="bottom">blah blah blah multi-line text here</div>
</div>
</div>
What i want to accomplish is the ../images/text-bottom.gif to be aligned at the end of the text.
no, simple display inline didn;t work.
yet i found a solution
i place the final word in a [span] tag, all text in [p] tag and modify my css as follow:
Using regular expression, i find the last word of my text, and i enclose it in [span] and it works like i want