Showing posts with label Post Source Codes. Show all posts
Showing posts with label Post Source Codes. Show all posts

Wednesday, July 6, 2011

Blog html code

There are many ways to post a html code on blogger. Here, I want to show you an easiest way to post a html code. Click here to see another example.

1. Go to Design / Layout
2. Click Edit HTML
3. Tick the "Expand Widget Templates" box
4. Add this code right before the tag <head>

<!-- post source code -->
<link href="http://alexgorbatchev.com/pub/sh/2.1.364/styles/shCore.css" rel="stylesheet" type="text/css"></link>
<link href="http://alexgorbatchev.com/pub/sh/2.1.364/styles/shThemeDefault.css" rel="stylesheet" type="text/css"></link>
<script src="http://alexgorbatchev.com/pub/sh/2.1.364/scripts/shCore.js" type="text/javascript">
</script>
<script src="http://alexgorbatchev.com/pub/sh/2.1.364/scripts/shBrushPerl.js" type="text/javascript">
</script>
<script src="http://alexgorbatchev.com/pub/sh/2.1.364/scripts/shBrushXml.js" type="text/javascript">
</script>
<script language="javascript">
SyntaxHighlighter.config.bloggerMode = true;
SyntaxHighlighter.config.clipboardSwf = 'http://alexgorbatchev.com/pub/sh/2.1.364/scripts/clipboard.swf'
SyntaxHighlighter.all();
</script>

5. To post the codes, insert the codes below to your post

<pre class="brush:perl"> 
....insert source codes here....
</pre>
Read more > Blog html code

Tuesday, July 5, 2011

Post codes in blog

1. Go to Design / Layout
2. Click Edit HTML
3. Tick "Expand Widget Templates" box
4. Find the tag "</body>"
5. Add this code just before/above the tag "</body>"


<!-- ADD SOURCE CODES TO BLOG POSTS -->
<link href='http://lockimage.googlepages.com/SyntaxHighlighter.css' rel='stylesheet' type='text/css'/>
<script language='javascript' src='http://lockimage.googlepages.com/shCore.js'/>
<script language='javascript' src='http://lockimage.googlepages.com/shBrushCpp.js'/>
<script language='javascript'>
dp.SyntaxHighlighter.BloggerMode();
dp.SyntaxHighlighter.HighlightAll(&quot;code&quot;);
</script>
<!-- END OF SOURCE CODES -->

6. Now to add source code to a post, it should be placed in <pre> tag.

<pre class="Cpp" name="code">
...insert code here...
</pre>
Read more > Post codes in blog
 
 
Copyright © blog
Blogger Theme by Blogger Designed and Optimized by Tipseo