The NEXT thing to try!!

Icon

Random rants and tips about NETCF, WinCE, Emacs, Powershell etc.

Putting Scrollable Code in wordpress

<div style=”overflow: auto; height: 350px; width: 100%; background-color: #aaaaaa “>
<pre style=”border-top: 2px solid #aaaaaa; border-bottom: 2px solid #aaaaaa; width: 100%;font-family: ‘Courier New’,Courier,Fixed”>

<– Your Code goes here — >

</pre></div>

Code that goes within these tags looks like this. If the lines are long, then it will automatically insert horizontal scrollbars. Check out the vertical and horizontal scrollbars.

Some extra lines for vertical scrollbar to appear

Some extra lines for vertical scrollbar to appear

Some extra lines for vertical scrollbar to appear

Some extra lines for vertical scrollbar to appear

Some extra lines for vertical scrollbar to appear

Some extra lines for vertical scrollbar to appear

Some extra lines for vertical scrollbar to appear

Some extra lines for vertical scrollbar to appear

Some extra lines for vertical scrollbar to appear

Some extra lines for vertical scrollbar to appear

Some extra lines for vertical scrollbar to appear

Some extra lines for vertical scrollbar to appear

I checked the approach for Firefox-2.0.0.7 and IE6 and it was working fine. There is one problem, that after saving the post if you want to re-edit the post, wordpress would have modified the code. So it is advisable to put these tags just before publishing your post.

Advertisements

Filed under: Blogging

4 Responses

  1. Andy says:

    Oh, and did not know about it. Thanks for the information …

  2. Mary M says:

    This is not working for me.

    I am not sure I am at the right place however, as I am looking for scrollable parts within a wordpress POST. Any idea how I can do that?

    The link below is just an illustration of the effect I would like to achieve. However, I do not that the site is wordpress-based
    http://www.creato.biz/l_bg/portfolio/165

    PS I want a similar effect not the same thing

    Thanks,
    Mary

  3. Neha says:

    thank
    that really a good thing putting scrolling option in blogging

  4. Neha says:

    that really a good thing putting scrolling option in blogging

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: