How to add Code Box to Blogspot Site's Article or Post

0

How to add Code Box to Blogspot Site's Article or Post?

If you want to add Code Box in Post / Article of Blogger Site, then this post How to Add Code Box in Blogger post.

How to add Code Box to Blogspot Site's
How to add Code Box to Blogspot Site's

Hello blogger! Welcome all of you to GeeksCodes. If you also want to add Code Box to the Post (Article) of your blog, then read this post carefully and understand without skipping.

How do I add Code Box to Blogspot Site's Article or Post in this post?

Friends, if you have installed any Free Blogger Template Install or Premium Blogger Template installed in your site, then you can easily add Code Box to your Blogspot Site's Article or Post by following the steps mentioned in this post.

Why is it necessary to add Code Box to Blogger Post?

Friends, sometimes what happens is that we have to write a post on some Keyword which is related to Coding like I have written this post, why is it necessary to add Code Box to Blogger Post? (Why is it necessary to add Code Box to Blogger Post?) In this we have to share Html Code, Java Code, JavaScript, etc code in our post, whereas all these codes can be very big. If we put this code directly in our post, then our article will look very bad and our visitor will not even understand. That's why we have kept adding Post Code Box in the post of our blog, you can see below.

So let's know how to add Code Box to Blogspot Site's Article or Post?

How to add Code Box to Blogspot Site's Article or Post? Go step by step.

Step1 :- Copy this code and paste it between <head> and </head> by going to Edit Html from your Blogger Dashboard.

<!--[www.geekscodes.com ]-->

<link href="https://cdn.jsdelivr.net/npm/highlight.js@10.7.2/styles/atelier-heath-dark.css" rel="stylesheet"></link>

Step.2 :- Now copy this code and paste it between <body> and </body>

<!--[www.geekscodes.com ]-->

<script src='//cdnjs.cloudflare.com/ajax/libs/highlight.js/10.7.2/highlight.min.js'/><script>hljs.highlightAll();</script>

Step.3 :-  Now copy this code and search for any style code between your <head> and </head> and paste it before </head>

&amp;lt;style&amp;gt; &amp;lt;!--[www.geekscodes.com ]--&amp;gt;
/* Highlighter */
.post-body code{padding:1.2em}.hljs{display:block;overflow-y:hidden;overflow-x:hidden;font-size:14px;padding:1.2em;background:#262a2d;color:#fff;line-height:1.5;text-align:left;word-spacing:0;font-family:monospace;border-radius:8px;max-height:350px}.hljs:hover,.hljs:focus{overflow-y:auto;overflow-x:auto}.hljs-name,.hljs-strong{font-weight:500}.hljs-code,.hljs-emphasis{font-style:italic}.hljs-tag{color:#55c8f9}.hljs-variable,.hljs-template-variable,.hljs-selector-id,.hljs-selector-class{color:#a2e4ff}.hljs-string,.hljs-bullet{color:#b3ffb3}.hljs-type,.hljs-title,.hljs-section,.hljs-attribute,.hljs-quote,.hljs-built_in,.hljs-builtin-name{color:#fdfd8e}.hljs-number,.hljs-symbol,.hljs-bullet{color:#fd4f4f}.hljs-keyword,.hljs-selector-tag,.hljs-literal{color:#fcc28c}.hljs-comment,.hljs-deletion,.hljs-code{color:rgba(255,255,255,.6)}.hljs-regexp,.hljs-link{color:#c6b4f0}.hljs-meta{color:#fc9b9b}.hljs-deletion{background-color:#fc9b9b;color:#333}.hljs-addition{background-color:#a2fca2;color:#333}.hljs a{color:inherit}.hljs a:focus,.hljs a:hover{color:inherit;text-decoration:underline}mark .hljs-attr,mark .hljs-string,mark .hljs-bullet{background-color:#f24a4a;color:#fff}.hljs mark{background-color:#f24a4a;color:#fff;padding:2px 5px;border-radius:2px}.BLOG_mobile_video_class{display:none!important}.hljs mark span.hljs-number,.hljs mark span.hljs-comment,.hljs mark span.hljs-symbol,.hljs mark span.hljs-string,.hljs mark span.hljs-attr,.hljs mark span.hljs-keyword,.hljs mark span.hljs-name,.hljs mark span.hljs-tag{color:#fff;margin:.15rem 0}.Night mark .hljs-attr,.Night mark .hljs-string,.Night mark .hljs-bullet{background-color:#2e86de;color:#fff}.hljs mark .hljs-selector-class{color:#fff}&amp;lt;/style&amp;gt;
Step.4 :- Now save it.
Read this also Now your Blogger Template me Post Code Box has been added, now you need to write a post.
Now according to the steps mentioned in this post, you have to add the code to the post.


Step.5 :- If you want to add Post Code Box to your Blogspot Website's Article or Post, then go to New Post or Edit Post in your Blogger's Dashboard and open it.

Step.6 :- Click on the Pencil Icon in the Left Side, then click on the HTML view.
How to add Code Box to Blogspot Site's Article or Post
Blog Post

Now search the place here where you want to show the code.
Note: If you paste the code before </div> or <br /> then no error will be shown.

HTML, JavaScript, Java, CSS, etc. Before adding any code to your post, copy that code and open the website given below and paste and copy as per the image below.

Note: If there is HTML code then follow the steps shown in the image.
Because Html Code Directly Paste will not show Code.

Step.7 :- Go to the HTML View and paste the Copied Code where you want to show it.
      And write <br/><pre><code> before the Copied Code and </code> </pre> <br/> at the end of the Copied Code.

Step.8 :- Now click on Compose View. To see this, you can see by clicking on Preview, in your post of Blog Post Box Code show will start inside.
Tags

Post a Comment

0Comments
Post a Comment (0)

#buttons=(Accept !) #days=(20)

Our website uses cookies to enhance your experience. Learn More
Accept !