Welcome to WebmasterWorld Guest from

Forum Moderators: not2easy

Message Too Old, No Replies

Background Wrapping

Is it possible to wrap the background color with the text?



9:44 pm on Jun 8, 2011 (gmt 0)

5+ Year Member

I'm busy designing a site that requires the following style:
[imageshack.us ]

The problem i'm having is trying to wrap the background around the text that is there.

The text in that area will come from twitter, so I can't separate each line-break before hand.

Is there any way I can get the background to wrap around the text as in the image?

This is the closest I can get. (note the width of each line is the same)
[imageshack.us ]

Thanks for viewing.


11:41 pm on Jun 8, 2011 (gmt 0)

WebmasterWorld Senior Member lucy24 is a WebmasterWorld Top Contributor of All Time Top Contributors Of The Month

I'm not sure your link is showing me the same thing it's showing you. Is the text supposed to be an image or a text string?

Can you set the text's own background-color to "transparent", or will the image be too dark (or too light, or too unpredictable) for readability?

If you can't give the text a transparent background, another approach that might work is:

span.opaque {color: inherit; background-color: white} /* or whatever your non-image background color really is */

Wrap the text in this span. If it needs to be inside a paragraph or other block-level element, set its background-color to transparent (I believe this is the default, but don't take chances) so the background image shows through. This works because "white" and "transparent" are different things, but the difference is only apparent when there's a background-image involved.

Featured Threads

Hot Threads This Week

Hot Threads This Month