Rodent of Unusual Size wrote:

I want to display an IRC conversation log fragment in an
HTML <pre> element.  I want the effect of white-space: pre-wrap,
so that text on each line that's too wide will wrap.  However,
when that happens I want the wrapped text to be indented, so
that it'll be clear that it's a continuation.

I could probably get the effect I want by putting each line
into an appropriately-styled <p> element or the like, but that's
awkward.

Is there any way to set a hanging indent on 'pre-wrap' text like
this?  Sort of treating each line from start to hard newline as
an implicit block element?


ROUS,

You can create a hanging indent effect by using a negative text-indent value. That pulls the first line off to the left, creating the appearance that all subsequent lines are indented.

However, this is dependent on each piece of text to be wrapped in some sort of container that you apply the text-indent to -- there's no such thing as an "implicit block element" as you mention. Either you've told the browser how to group the content, or you haven't. If you just have all the pieces of text plopped in a pre element, you wouldn't have anything to apply the text-indent property to. I suppose you could wrap each piece of text in its own pre element, rather than just have one pre element for the entire conversation?

Zoe

--
Zoe M. Gillenwater
Design Services Manager
UNC Highway Safety Research Center
http://www.hsrc.unc.edu

______________________________________________________________________
css-discuss [EMAIL PROTECTED]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/

Reply via email to