endy
10-03-2006, 09:51 PM
I have text that is formated with <pre> going in to a <div> which has its width constrained to 80%. If I want the text not to bust through the <div> and streem endlessly right, what should I do?
-Thanks!
-Thanks!
|
||||
controling <pre> widthendy 10-03-2006, 09:51 PM I have text that is formated with <pre> going in to a <div> which has its width constrained to 80%. If I want the text not to bust through the <div> and streem endlessly right, what should I do? -Thanks! felgall 10-03-2006, 11:21 PM You could set overflow:hidden or overflow:scroll for the pre tag. The first will hide what wont fit while the second will add a scrollbar to the pre tag when it is needed. mark87 10-03-2006, 11:32 PM Have you tried giving the <pre> a width (possibly of 80%) too? endy 10-04-2006, 12:38 AM the thing is, that I want the text to form a column, as one might do by placing it inside a div. I tryed the width on the pre tag itsef already, didnt do anything. Any other ideas? Arbitrator 10-04-2006, 01:41 AM I'm guessing that you want new-line and white-space formatting to be preserved but for wrapping to also occur? You would use white-space: pre-wrap for that. Support for it is pretty poor though. Resources: Web Browser CSS Support (http://www.webdevout.net/browser_support_css.php?IE6=on&IE7=on&FX1_5=on&FX2=on&OP9=on&KN3_5=on&SF2=on&uas=CUSTOM#css2propsbasic) White-Space and Generated Content (http://cheeaun.phoenity.com/weblog/2005/06/whitespace-and-generated-content.html) endy 10-04-2006, 08:48 PM Ahh it worked! pre{ font-family:Georgia, "Times New Roman", Times, serif; white-space: pre; /* CSS2 */ white-space: -moz-pre-wrap; /* Mozilla */ white-space: -hp-pre-wrap; /* HP printers */ white-space: -o-pre-wrap; /* Opera 7 */ white-space: -pre-wrap; /* Opera 4-6 */ white-space: pre-wrap; /* CSS 2.1 */ white-space: pre-line; /* CSS 3 (and 2.1 as well, actually) */ word-wrap: break-word; /* IE */ } that setup gleened off one of your resources did the trick. Thanks! |
| |||
EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum