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?


Set the word-wrap property to normal.

| improve this answer | |

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

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

Use Code Prettify.

I' have written some notes on how to.

| improve this answer | |

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.

| improve this answer | |

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.

| improve this answer | |

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

just write/paste code there.

| improve this answer | |
  • How does it answer the question? – Thierry Dalon Sep 8 '16 at 19:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy