The Scientech Hub is the blog about the science and technology. We share latest information about science and technology. Latest tools, technology, systems, gadgets, space science, bioscience, physical world are shared hear.

Monday, October 15, 2018

How To Add Code Box On Blogger Post

Trying to Share Code Snippet on a blog post? But unable to do so, Don't worry because I am here to help you.
So, Today I am going to tell you how to add a code snippet on your blog post. If you are a blogger and have a blog about programming or for helping other bloggers you would need maximum times to share code snippet with your visitors. How would it look if you share that code snippet in a separate box? Exactly it would look stylish, beautiful and it will help visitors to read and copy that code easily.

how-to-add-code-box-on-blogger-post

How To Add Code Box On Blogger.

There are two different ways to add code box on blogger.
First one is to add a code snippet on blogger theme and another one is to add code on additional CSS page. I will tell you both methods however the second one is very simple and easy.

First method.  

1. Login to Blogger Dashboard
2. Then click on Theme > Now Click >Edit HTML
3. Click anywhere on the code area and press Ctrl + F. Search box will open.
4. Now wright or past " ]]<b/:skin> " on the search box and hit the enter button on your keyboard.
5. Just above the " ]]<b/:skin> " past the below-given code. 

You need to past only one of them if you will add both the given codes you will get an error.

Code 1. If you want to add code with scroll add the following code.
.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. If you want to add code without Scroll add the following code.
.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 Save the template and that's all you are done

Second Method (Recommended)

1. Login to Blogger Dashboard
2. Click  on Theme > Now Click > Customize
3. Find Advanced option on the top left of the screen and hit that button
4. Then click Add CSS
5. Past one of the above-given codes and click the Apply To Blog button.
6. Now you are done.

How To Use This

In order to use this just follow the below steps.
1. To use this just click on the HTML  of your blog post editor.
2. Now write or past the below-given code in your blogger post editor.

how-to-add-code-box-in-blogger


<div class="code">
Enter Your Code Here
</div>
3. Replace "Enter Your Code Here" with the code you want to share.
4. Publish your post and see the magic of CSS.

So, friends, this was the post about how to add code box on blogger post. Hope you like the post. If you have any issue please comment below the post or you can contact me using either Contact Me page or Contact form. 
Share:

25 comments:

  1. The article was up to the point and described the information very effectively. Thanks to blog author for wonderful and informative post.
    website designing Service

    ReplyDelete
  2. I try this code box on my blog website but my code running in post

    ReplyDelete
  3. Thank you so much sir for writing such a wonderful article .i admire your creativity and your knowledge.this is the best website i have ever found on internet.i am so grateful to you for providing informative article .You are truly my inspiration.kindly click here to visit my website for blogging tips Technical Bishnuji

    ReplyDelete
  4. Thanks For Sharing this Post.
    You can also checkout mines one i hope you like it.
    How To Add Code Box In Blogger

    ReplyDelete
  5. Really great article. You can learn about programming and robotics, Visit Now! Thanks!

    ReplyDelete
  6. This comment has been removed by the author.

    ReplyDelete
  7. good information. can we write java n android codes inside it? coz I wanna focus my blog on Android development using mobile device. I write other topics as "seasoning", though.

    this is one of my post about one of the biggest and beautiful caterpillar we can find in wingedbean plants.
    One of the biggest caterpillar in the world, upto 12cm in length

    ReplyDelete
  8. Great blog post. Thanks for sharing with us. Keep it up. If you want to activate roku streaming device then you need to enter link code. For more details about roku device or roku activation you may contact us at any time.

    Enter Link Code
    Roku Com Link

    ReplyDelete
  9. Hey thanks for sharing & free guide that you may like on clicking Affizoo.

    ReplyDelete
  10. How to Enter Code in amazon.com/mytv?
    First, turn on the preferred streaming device

    Go to applications to find out about Amazon Prime

    Once you have launched the app, click on Register on amazon website

    Or else complete the login process to get the www.amazon.com/mytv enter code

    Now note down the code and on your browser visit www.amazon.com/mytv

    Enter the necessary details and provide www.amazon.com/mytv login details

    Then finally enter the activation code.
    www.amazon.com/mytv enter code
    amazon.com/mytv
    www.amazon.com/mytv code
    amazon.com mytv code

    ReplyDelete
  11. I’ve read several excellent stsite 먹튀검증백과커뮤니티

    ReplyDelete
  12. Hey I know this is off topic let me know if you run into anything. I truly enjoy reading your blog and I look forward to your new updates. 먹튀검증백과커뮤니티

    ReplyDelete
  13. I like your posts and ev to yours. 먹튀뱅크검증커뮤니티

    ReplyDelete

Copyright © The Scientech Hub | Blog of Science and Technology | Powered by Blogger Design by ronangelo | Blogger Theme by NewBloggerThemes.com