Is possible to hide or scroll the overflow?

CodeHighlighter for ASP.NET Forum

Posted 14 years ago by Jortx
Avatar
Hi,
I'm trying to write a few chars in the same line, inside the control, and the result is the PRE gets bigger than the screen, in place of show the scroll bars o hide the overflow.
I've tried to set de overflow: scroll and overflow: hidden , in the CSS class used by the PRE control, unsuccessfully.
Maybe there is another way to change it... I hope it.
Thanks a lot!

[Modified at 01/27/2010 06:58 AM]

Comments (4)

Posted 14 years ago by Jortx
Avatar
Ok.
I've tried to set a fix width to the PRE, and then it works. I can see the scroll bars.
So, without setting a fix with, is there a way to show the scroll bars when the content is biger?
Thanks for the replies.
Posted 14 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Jortx,

We wrap our PRE tags with a div like this:
<div class="ForumPostCode"><pre>...</pre></div>
Then here is our CSS for that:
.ForumPostCode { margin: 0.5em 0px 0.5em 15px; width: 650px; overflow: auto; }
But we use fixed width. You'd have to consult some other CSS forums for more help with overflow if you are having trouble since that is outside the scope of this control.


Actipro Software Support

Posted 14 years ago by Jortx
Avatar
OK! Thanks for your response.
The latest build of this product (v4.0.59) was released 13 years ago, which was before the next post in this thread.
Posted 12 years ago by roydukkey
Avatar

You have to use the white-space property of CSS. With the following and some simple CSS a horizontal scrollbar can be accomplished:

<pre class="highlighter"><cdh:CodeHighlighter runat="server" LanguageKey="XML" /></pre>

 CodeHighlighter will also insert a div into the pre tag which we can style with the white-space property.

pre.highlighter { overflow-x: auto; }
pre.highlighter div { display: inline-block; white-space: pre; }

 Hope this helps everyone landing on this page.

[Modified 12 years ago]