homepage Welcome to WebmasterWorld Guest from 54.226.80.196
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Visit PubCon.com
Home / Forums Index / Code, Content, and Presentation / HTML
Forum Library, Charter, Moderators: incrediBILL

HTML Forum

    
Wrapping <pre> text naturally
I want the carriage returns... but not the nowrap bahaviour
joshie76




msg:616614
 12:06 pm on Jun 11, 2003 (gmt 0)

Hi all,

How's it going?

I need to use the pre tag or an equivalent to get display some text and maintain the line breaks... but the text must also wrap naturally when it hits a specified boundary (width) example:

<pre style="width:100px">
The following carriage return is displayed..

But this line will force the display much wider then intended because it is so looong...
</pre>

I'm sure you get the picture. Because we are using XSL call-templates (that use a copy-of) to display the code we cannot just replace a CR with a <br/> - it just can't happen that way unfortunately...

so we need to find a way to deal with it in HTML/CSS and I'm sure one of you guys will have the answer (this needs only work for me in IE5+ BTW)

Thanks in advance y'all

 

joshie76




msg:616615
 12:11 pm on Jun 11, 2003 (gmt 0)

Sometimes, just visiting WebmasterWorld is enough to set me off in the right direction!

A textarea does almost what I need but for the scrollbars... bingo!

<textarea style="overflow:visible" readonly="readonly">

If anyone has a better (less hacky solution) I'd love to hear it.

:)

Josh

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / HTML
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved