Ever tried to display a bunch of code snippet through a Tumblr Post, just to later see it just doesn’t show once it’s published?. Syntax Highlighting in Tumblr can be done using more than one method.
How To Show Code Snippets in a Tumblr Post
- Go to Customize Appereance >> Edit HTML
- Paste the following code chunk right before the </head> tag. Update preview and then SAVE and close
- Example 2. HTML.
- Create a post >> Click on the HTML editor and create code snippets as shown in the examples above.
- Preview the Post to see it in action.
- Don’t worry if you don’t see the code snippet within the regular editor (for example, a html link). If you do a preview, you will notice how it changes and displays the code the way it should.
<link rel="stylesheet" type="text/css" href="http://static.tumblr.com/p2evvtm/MRzlypsda/styles.css"></link> <script src="http://static.tumblr.com/p2evvtm/qJBlypsdm/clean_tumblr_pre.js"></script>
<pre><code class="html"> <html> <body> <h1>My First Heading</h1> <p>My first paragraph.</p> </body> </html> </code>