I noticed that when I post source code in a Blogger post, the code wraps to the next line if it's too long. I use the pre tag to post the code and I used different styles (overflow: auto; white-space: pre), still the code wraps in all browsers except in FireFox.

Is there a way to post source code without having the code wraps?

6 Answers 6


Set the word-wrap property to normal.


Checkout Syntax Highlighter if you already haven't. You can easily integrate it with blogger.

  • +1: Finally, a syntax highlighter that doesn't copy over the line numbers! Many thanks, sir!
    – Jay Wick
    Sep 13, 2010 at 3:00

Use Code Prettify.

I' have written some notes on how to.


I've been using PreCode and SyntaxHighlighter for a while and it seems to work best for me. My blog readers also enjoy copy/pasting functionality built-in.


Using Github Gist, you can create "pretty" code which you can embed within a Blogger post. If you modify this code anytime, it will automatically show up in the blog post as well.


Click on New Post Then Compose Mode write your code there. enter image description here

just write/paste code there.

  • How does it answer the question? Sep 8, 2016 at 19:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.