PDA

View Full Version : Is it possible for a text background color to wrap?



jhowell009
Mar 1st, 2010, 11:08 PM
Not sure how to correctly describe this. I'm looking for the background color of my type to literally stay behind the text only, and not fill the entire DIV that it occupies. See photos below for a better idea of what I am asking about.

The catch here is that the words will be pulled dynamically from a pool, so I can't cut graphics in this case.

I should clarify that it is for a company internet so any type of hack, java workaround or other would probably be acceptable. Thanks in advance to those much smarter than me.

This is what I would like to output.

Example A
http://i27.photobucket.com/albums/c197/itgoeswoar/Picture11.png

Exaxmple B
http://i27.photobucket.com/albums/c197/itgoeswoar/Picture12.png

What I don't want
http://i27.photobucket.com/albums/c197/itgoeswoar/Picture14.png

met
Mar 1st, 2010, 11:12 PM
<div style="background:blue;height:300px;width:300px; padding:10px;">
<p style="padding:5px;"><span style="background:red;">Some text here.</span></p>
<p style="padding:5px;"><span style="background:red;">Some text here.</span></p>
<p style="padding:5px;"><span style="background:red;">Some text here.</span></p>
</div>

use of inline styles strictly for demo

unless you mean like a "cut out"? in which case no idea sorry

http://my.opera.com/dstorey/blog/using-svg-masks-for-cut-out-text-effects might be worth a read

jhowell009
Mar 1st, 2010, 11:39 PM
Thanks met, that is what I was looking for at the link. I'll give it a go.

If not I'll work something else out.