When you write about the blogger on your blog you may have shared code to paste in Template. It’s good to share that codes in a separate code box in a way that it looks stylish. And it’s helpful for visitors because they can copy the code easily from code box.
How To Add Code Box In Blogger
1. Login to your blogger blog Dashboard.
2. Then go to ” Theme ” > ” Edit HTML “.
3. Click anywhere inside the code area and press Ctrl + F keys to open the search box.
4. Write or paste ” ]]</b:skin> “code in search box and press Enter.
5. Just above ” ]]</b:skin> ” paste the code box CSS code given below:
Code 1. For Style 1 Copy This Code [With Scroll]
.code { background:#f5f8fa; background-repeat:no-repeat; border: solid #5C7B90; border-width: 1px 1px 1px 20px; color: #000000; font: 13px ‘Courier New’, Courier, monospace; line-height: 16px; margin: 10px 0 10px 10px; max-height: 200px; min-height: 16px; overflow: auto; padding: 28px 10px 10px; width: 90%; }
.code:hover { background-repeat:no-repeat; }
Code 2. For Style 2 Copy This Code [Without Scroll]
.code { background:#f5f8fa; background-repeat:no-repeat; border: solid #5C7B90; border-width: 1px 1px 1px 20px; color: #000000; font: 13px ‘Courier New’, Courier, monospace; line-height: 16px; margin: 10px 0 10px 10px; min-height: 16px; overflow: auto; padding: 28px 10px 10px; width: 90%; }
.code:hover { background-repeat:no-repeat; }
6. Now click on ” Save Template ” and you are done.
How To Use This
<div class=”code”>
Your Code Here
</div>
3. Replace ” Your Code Here ” with your desired code.
4. Now click on ” Publish Button ” and see it live.
So, this was a guide about adding code box in blogger blog. If you have any problem related to this article, comment below and do not forget to share this article.
Related: add scrollbars to a Blogger blockquote


Latest 4 of 11 Comments