Showing posts with label blogger. Show all posts
Showing posts with label blogger. Show all posts

Wednesday, 9 June 2010

How to Add a Code Box in Blogger

This has been nagging at me for some time... why, oh why, does Blogger not have a code box built into the editing interface???   In the past I've used adjustable text boxes and other weird presentation formats to simulate code boxes but they are lengthy and cumbersome.  Here's how to create an easy-to-use, stylish code box for your blogger articles.

From your Blogger account, click Layout in the top menubar and select Edit HTML on the resulting page. You may want to save a copy of this template if you have previously modified it in any way.  Find the text ]]></b:skin> and add the following code immediately before it

.code {color: #006AB0; border : 1px solid #DADADA;padding : 5px 5px;font-family : Consolas, "Courier New", Courier, mono, serif;font-size : 12px;background-color : #fAfAfA; width : 90%;overflow : auto;margin : 10px 0 10px 10px; border-left : 20px solid #DADADA;max-height : 500px;min-height : 16px;line-height : 16px;}
.code:hover {background-color : #f3f3f3;
Make sure you added this code BEFORE the red text above.  Save your template.

Now you're finished!  To create a code box in a Blogger post, just insert your "code" like so:
<div class="code">
INSERT CODE HERE
</div>

Note that the code box shown above is not my design, but was taken from Bariski.

Tuesday, 7 July 2009

Add 3rd column to Blogger template

Want to add 3 columns to your Blogger template? This post will show you how to update your Blogger layout a to WidgetSidebar - Main Post - WidgetSidebar format (based on Blogger's "Minima" template). Here's how:

Backup your current template
You can do this by logging into your Blogger account and selecting Layout > Edit HTML. Check the Expand Widget Templates box and then click the Download Full Template link. Save a copy to your desktop just in case this doesn't work :-) I also recommend writing down a list of all your sidebar widgets.

Download this template
Right click here, select Save Link As... and save the file to your desktop. This is the minibox template, courtesy of www.2600degrees.com.

Update your code
Open the saved .xml template file with a text editor like Wordpad and copy the entire body of code. Go back to your Blogger browser window and replace all current code with the copied portion from Wordpad. Preview before saving, and if all looks good Save Template (WARNING: you may lose all your Widget data by saving your template). You may have to do some minor adjustments to make everything fit (I had to adjust the widths of each sidebar wrapper). If you lost Widget data, go back to Layout and add your widgets again. You will notice that you now have 3 columns!

  © Blogger template 'Isolation' by Ourblogtemplates.com 2008

Back to TOP