WordPress Format Code Quicky

After wasting hours trying to get something to format my code examples for my free WordPress blog I found that the pre tag does most of what is needed…indention. If you don’t need fancy syntax highlighting out of the box this is the solution involving the least effort.

Wrapping the <pre> tag in <div style=”overflow:auto;”> will take care of the code going over the borders of the post.


Tags: , ,

2 Responses to “WordPress Format Code Quicky”

  1. Marcia Celular Says:

    what is overflow:auto ? my comments go over the box i made. I think is the same issue as you mentioned.

  2. zaries Says:

    The overflow property specifies what happens if content overflows an element’s box. Auto says if overflow is clipped, a scroll-bar should be added to see the rest of the content. You can learn more about it here

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: