Word-Wrapping [code] tags?

Status
Not open for further replies.

sherwood

Active Member
805
2008
0
0
Is there away that I can edit the template bbcode_code or edit something so that the code tag will wordwrap when a user posts something that exceeds like 600px?

Thanks
 
10 comments
Add
Code:
white-space: pre-wrap;
like this

Code:
<div style="margin:20px; margin-top:5px">
    <div class="smallfont" style="margin-bottom:2px">$vbphrase[[COLOR=Red]c0de[/COLOR]]:</div>
    <pre class="alt2" dir="ltr" style="
        [COLOR=Red]white-space: pre-wrap;[/COLOR]
        margin: 0px;
        padding: $stylevar[cellpadding]px;
        border: 1px inset;
        width: $stylevar[codeblockwidth];
        height: {$blockheight}px;
        text-align: left;
        overflow: auto;">$code</pre>
</div>

Also the [c0de] tag I highlighted, should be an o of course

Let me know if that works for you
 
yup,

Also is there away to make text in that box justified? instead of aligned left.

I tried this but didn't do anything

Code:
<div style="margin:20px; margin-top:5px">
    <div class="smallfont" style="margin-bottom:2px">$vbphrase[COLOR="Red"][c0de][/COLOR]:</div>
    <pre class="alt2" dir="ltr" style="
        white-space: pre-wrap;
        margin: 0px;
        padding: $stylevar[cellpadding]px;
        border: 1px inset;
        width: $stylevar[codeblockwidth];
        height: {$blockheight}px;
        text-align: [COLOR="Red"]justified[/COLOR];
        overflow: auto;">$code</pre>
</div>
 
Yeah I noticed it was justify after I posted so I tried that and still nothing,

and the reason I wanted it justified is that I wanted to see how it looked as it normally looks better that just left align.
 
I can't test this right now but try this out, on the overflow: auto line

Code:
overflow: auto;"><span style="text-align: justify">$code</span></pre>
 
Status
Not open for further replies.
Back
Top