Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource

JavaScript

Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

Behavior

Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                <div class="post-body">
<pre class="javascript"><code>&lt;script&gt; //&lt;![CDATA[
  /*
    Sticky Header. Auto hide on scroll bottom, show on scroll top.
    By: www.faizaltech98.blogspot.com
  */
  var prevScrollpos = window.pageYOffset;
  window.onscroll = function() {
    var currentScrollPos = window.pageYOffset;
    if (prevScrollpos &gt; currentScrollPos) {
      document.getElementById(&quot;header&quot;).classList.remove(&#039;show&#039;);
    }
    else { document.getElementById(&quot;header&quot;).classList.add(&#039;show&#039;);
    }
    prevScrollpos = currentScrollPos;
  }
//]]&gt; &lt;/script&gt;</code></pre>
<pre class="css"><code>/* WRAPPER */
#wrapper {
background:$(posts.background.color);
max-width:1000px; 
margin:0 auto; 
padding:70px 30px 30px; 
overflow:hidden; 
}</code></pre>
<pre class="html"><code>&lt;b:includable id=&#039;postsharebutton&#039; var=&#039;post&#039;&gt;
&lt;div class=&#039;faizalltmShare&#039;&gt;
&lt;span class=&#039;total&#039;&gt;&lt;svg viewBox=&#039;0 0 24 24&#039;&gt;&lt;path d=&#039;M18,16.08C17.24,16.08 16.56,16.38 16.04,16.85L8.91,12.7C8.96,12.47 9,12.24 9,12C9,11.76 8.96,11.53 8.91,11.3L15.96,7.19C16.5,7.69 17.21,8 18,8A3,3 0 0,0 21,5A3,3 0 0,0 18,2A3,3 0 0,0 15,5C15,5.24 15.04,5.47 15.09,5.7L8.04,9.81C7.5,9.31 6.79,9 6,9A3,3 0 0,0 3,12A3,3 0 0,0 6,15C6.79,15 7.5,14.69 8.04,14.19L15.16,18.34C15.11,18.55 15.08,18.77 15.08,19C15.08,20.61 16.39,21.91 18,21.91C19.61,21.91 20.92,20.61 20.92,19A2.92,2.92 0 0,0 18,16.08Z&#039;/&gt;&lt;/svg&gt;&lt;i&gt;SHARE&lt;/i&gt;&lt;/span&gt;
&lt;a class=&#039;facebook&#039; expr:href=&#039;&amp;quot;https://www.facebook.com/sharer.php?u=&amp;quot; + data:blog.url&#039; onclick=&#039;window.open(this.href,&amp;quot;sharer&amp;quot;,&amp;quot; toolbar=0,status=0,width=626,height=436&amp;quot;);return false;&#039; rel=&#039;nofollow&#039; title=&#039;Share to Facebook&#039;&gt;&lt;svg viewBox=&#039;0 0 24 24&#039;&gt;&lt;path d=&#039;M17,2V2H17V6H15C14.31,6 14,6.81 14,7.5V10H14L17,10V14H14V22H10V14H7V10H10V6A4,4 0 0,1 14,2H17Z&#039;/&gt;&lt;/svg&gt;&lt;/a&gt;
&lt;a class=&#039;twitter&#039; expr:href=&#039;&amp;quot;https://twitter.com/share?url=&amp;quot; + data:post.url&#039; onclick=&#039;window.open(this.href,&amp;quot;   sharer&amp;quot;   ,&amp;quot;   toolbar=0,status=0,width=626,height=436&amp;quot;   );   return false;&#039; rel=&#039;nofollow&#039; title=&#039;Share to Twitter&#039;&gt;&lt;svg viewBox=&#039;0 0 24 24&#039;&gt;&lt;path d=&#039;M22.46,6C21.69,6.35 20.86,6.58 20,6.69C20.88,6.16 21.56,5.32 21.88,4.31C21.05,4.81 20.13,5.16 19.16,5.36C18.37,4.5 17.26,4 16,4C13.65,4 11.73,5.92 11.73,8.29C11.73,8.63 11.77,8.96 11.84,9.27C8.28,9.09 5.11,7.38 3,4.79C2.63,5.42 2.42,6.16 2.42,6.94C2.42,8.43 3.17,9.75 4.33,10.5C3.62,10.5 2.96,10.3 2.38,10C2.38,10 2.38,10 2.38,10.03C2.38,12.11 3.86,13.85 5.82,14.24C5.46,14.34 5.08,14.39 4.69,14.39C4.42,14.39 4.15,14.36 3.89,14.31C4.43,16 6,17.26 7.89,17.29C6.43,18.45 4.58,19.13 2.56,19.13C2.22,19.13 1.88,19.11 1.54,19.07C3.44,20.29 5.7,21 8.12,21C16,21 20.33,14.46 20.33,8.79C20.33,8.6 20.33,8.42 20.32,8.23C21.16,7.63 21.88,6.87 22.46,6Z&#039;/&gt;&lt;/svg&gt;&lt;/a&gt;
&lt;a class=&#039;pinterest&#039; data-pin-config=&#039;beside&#039; expr:href=&#039;&amp;quot;https://pinterest.com/pin/create/button/?url=&amp;quot; + data:post.url + &amp;quot;&amp;amp;amp;media=&amp;quot; + data:blog.postImageUrl + &amp;quot;&amp;amp;amp;description=&amp;quot; + data:post.title&#039; onclick=&#039;window.open(this.href,&amp;quot;   sharer&amp;quot;   ,&amp;quot;   toolbar=0,status=0,width=626,height=500&amp;quot;   );   return false;&#039; rel=&#039;nofollow&#039; title=&#039;Share to Pinterest&#039;&gt;&lt;svg viewBox=&#039;0 0 24 24&#039;&gt;&lt;path d=&#039;M9.04,21.54C10,21.83 10.97,22 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2A10,10 0 0,0 2,12C2,16.25 4.67,19.9 8.44,21.34C8.35,20.56 8.26,19.27 8.44,18.38L9.59,13.44C9.59,13.44 9.3,12.86 9.3,11.94C9.3,10.56 10.16,9.53 11.14,9.53C12,9.53 12.4,10.16 12.4,10.97C12.4,11.83 11.83,13.06 11.54,14.24C11.37,15.22 12.06,16.08 13.06,16.08C14.84,16.08 16.22,14.18 16.22,11.5C16.22,9.1 14.5,7.46 12.03,7.46C9.21,7.46 7.55,9.56 7.55,11.77C7.55,12.63 7.83,13.5 8.29,14.07C8.38,14.13 8.38,14.21 8.35,14.36L8.06,15.45C8.06,15.62 7.95,15.68 7.78,15.56C6.5,15 5.76,13.18 5.76,11.71C5.76,8.55 8,5.68 12.32,5.68C15.76,5.68 18.44,8.15 18.44,11.43C18.44,14.87 16.31,17.63 13.26,17.63C12.29,17.63 11.34,17.11 11,16.5L10.33,18.87C10.1,19.73 9.47,20.88 9.04,21.57V21.54Z&#039;/&gt;&lt;/svg&gt;&lt;/a&gt;
&lt;a class=&#039;linkedin&#039; expr:href=&#039;&amp;quot;https://www.linkedin.com/shareArticle?mini=true&amp;amp;url=&amp;quot; + data:post.url + &amp;quot;&amp;amp;title=&amp;quot; + data:post.title + &amp;quot;&amp;amp;summary=&amp;quot; + data:post.snippet&#039; onclick=&#039;window.open(this.href,&amp;quot;   sharer&amp;quot;   ,&amp;quot;toolbar=0,status=0,width=626,height=500&amp;quot;);   return false;&#039; rel=&#039;nofollow&#039; title=&#039;Share to Linkedin&#039;&gt;&lt;svg viewBox=&#039;0 0 24 24&#039;&gt;&lt;path d=&#039;M21,21H17V14.25C17,13.19 15.81,12.31 14.75,12.31C13.69,12.31 13,13.19 13,14.25V21H9V9H13V11C13.66,9.93 15.36,9.24 16.5,9.24C19,9.24 21,11.28 21,13.75V21M7,21H3V9H7V21M5,3A2,2 0 0,1 7,5A2,2 0 0,1 5,7A2,2 0 0,1 3,5A2,2 0 0,1 5,3Z&#039;/&gt;&lt;/svg&gt;&lt;/a&gt;
&lt;a class=&#039;whatsapp&#039; data-notes=&#039;right&#039; expr:href=&#039;&amp;quot;https://api.whatsapp.com/send?text=&amp;quot; + data:post.title + &amp;quot; &amp;quot; + data:post.url&#039; onclick=&#039;window.open(this.href,&amp;quot;   sharer&amp;quot;   ,&amp;quot;toolbar=0,status=0,width=626,height=500&amp;quot;);   return false;&#039; rel=&#039;nofollow&#039; title=&#039;Share to Whatsapp&#039;&gt;
&lt;svg aria-hidden=&#039;true&#039; class=&#039;svg-inline--fa fa-whatsapp fa-w-14&#039; data-icon=&#039;whatsapp&#039; data-prefix=&#039;fab&#039; focusable=&#039;false&#039; role=&#039;img&#039; viewBox=&#039;0 0 448 512&#039; xmlns=&#039;http://www.w3.org/2000/svg&#039;&gt;&lt;path d=&#039;M380.9 97.1C339 55.1 283.2 32 223.9 32c-122.4 0-222 99.6-222 222 0 39.1 10.2 77.3 29.6 111L0 480l117.7-30.9c32.4 17.7 68.9 27 106.1 27h.1c122.3 0 224.1-99.6 224.1-222 0-59.3-25.2-115-67.1-157zm-157 341.6c-33.2 0-65.7-8.9-94-25.7l-6.7-4-69.8 18.3L72 359.2l-4.4-7c-18.5-29.4-28.2-63.3-28.2-98.2 0-101.7 82.8-184.5 184.6-184.5 49.3 0 95.6 19.2 130.4 54.1 34.8 34.9 56.2 81.2 56.1 130.5 0 101.8-84.9 184.6-186.6 184.6zm101.2-138.2c-5.5-2.8-32.8-16.2-37.9-18-5.1-1.9-8.8-2.8-12.5 2.8-3.7 5.6-14.3 18-17.6 21.8-3.2 3.7-6.5 4.2-12 1.4-32.6-16.3-54-29.1-75.5-66-5.7-9.8 5.7-9.1 16.3-30.3 1.8-3.7.9-6.9-.5-9.7-1.4-2.8-12.5-30.1-17.1-41.2-4.5-10.8-9.1-9.3-12.5-9.5-3.2-.2-6.9-.2-10.6-.2-3.7 0-9.7 1.4-14.8 6.9-5.1 5.6-19.4 19-19.4 46.3 0 27.3 19.9 53.7 22.6 57.4 2.8 3.7 39.1 59.7 94.8 83.8 35.2 15.2 49 16.5 66.6 13.9 10.7-1.6 32.8-13.4 37.4-26.4 4.6-13 4.6-24.1 3.2-26.4-1.3-2.5-5-3.9-10.5-6.6z&#039; fill=&#039;currentColor&#039;/&gt;&lt;/svg&gt;&lt;/a&gt;
&lt;a class=&#039;telegram&#039; expr:href=&#039;&amp;quot;https://telegram.me/share/url?text=&amp;quot; + data:post.title + &amp;quot;&amp;amp;url=&amp;quot; + data:post.canonicalUrl&#039; rel=&#039;noopener&#039; target=&#039;_blank&#039; title=&#039;Share to Telegram&#039;&gt;&lt;svg viewBox=&#039;0 0 24 24&#039;&gt;&lt;path d=&#039;M.707 8.475C.275 8.64 0 9.508 0 9.508s.284.867.718 1.03l5.09 1.897 1.986 6.38a1.102 1.102 0 0 0 1.75.527l2.96-2.41a.405.405 0 0 1 .494-.013l5.34 3.87a1.1 1.1 0 0 0 1.046.135 1.1 1.1 0 0 0 .682-.803l3.91-18.795A1.102 1.102 0 0 0 22.5.075L.706 8.475z&#039;/&gt;&lt;/svg&gt;&lt;/a&gt;
&lt;a class=&#039;line&#039; expr:href=&#039;&amp;quot;https://timeline.line.me/social-plugin/share?url=&amp;quot; + data:post.canonicalUrl&#039; rel=&#039;noopener&#039; target=&#039;_blank&#039; title=&#039;Share on Line&#039;&gt;&lt;svg viewBox=&#039;0 0 24 24&#039;&gt;&lt;path d=&#039;M19.365 9.863c.349 0 .63.285.63.631 0 .345-.281.63-.63.63H17.61v1.125h1.755c.349 0 .63.283.63.63 0 .344-.281.629-.63.629h-2.386c-.345 0-.627-.285-.627-.629V8.108c0-.345.282-.63.63-.63h2.386c.346 0 .627.285.627.63 0 .349-.281.63-.63.63H17.61v1.125h1.755zm-3.855 3.016c0 .27-.174.51-.432.596-.064.021-.133.031-.199.031-.211 0-.391-.09-.51-.25l-2.443-3.317v2.94c0 .344-.279.629-.631.629-.346 0-.626-.285-.626-.629V8.108c0-.27.173-.51.43-.595.06-.023.136-.033.194-.033.195 0 .375.104.495.254l2.462 3.33V8.108c0-.345.282-.63.63-.63.345 0 .63.285.63.63v4.771zm-5.741 0c0 .344-.282.629-.631.629-.345 0-.627-.285-.627-.629V8.108c0-.345.282-.63.63-.63.346 0 .628.285.628.63v4.771zm-2.466.629H4.917c-.345 0-.63-.285-.63-.629V8.108c0-.345.285-.63.63-.63.348 0 .63.285.63.63v4.141h1.756c.348 0 .629.283.629.63 0 .344-.282.629-.629.629M24 10.314C24 4.943 18.615.572 12 .572S0 4.943 0 10.314c0 4.811 4.27 8.842 10.035 9.608.391.082.923.258 1.058.59.12.301.079.766.038 1.08l-.164 1.02c-.045.301-.24 1.186 1.049.645 1.291-.539 6.916-4.078 9.436-6.975C23.176 14.393 24 12.458 24 10.314&#039;/&gt;&lt;/svg&gt;&lt;/a&gt;
&lt;a class=&#039;gmail&#039; expr:href=&#039;&amp;quot;https://mail.google.com/mail/u/0/?view=cm&amp;amp;ui=2&amp;amp;tf=0&amp;amp;fs=1&amp;amp;su=&amp;quot; + data:post.title + &amp;quot;&amp;amp;body=&amp;quot; + data:post.canonicalUrl&#039; rel=&#039;noopener&#039; target=&#039;_blank&#039; title=&#039;Share on Gmail&#039;&gt;&lt;svg viewBox=&#039;0 0 24 24&#039;&gt;&lt;path d=&#039;M20,18H18V9.25L12,13L6,9.25V18H4V6H5.2L12,10.25L18.8,6H20M20,4H4C2.89,4 2,4.89 2,6V18A2,2 0 0,0 4,20H20A2,2 0 0,0 22,18V6C22,4.89 21.1,4 20,4Z&#039;/&gt;&lt;/svg&gt;&lt;/a&gt;
&lt;/div&gt;
&lt;/b:includable&gt;</code></pre>
<pre class="jquery"><code>&lt;!DOCTYPE html&gt;
&lt;html&gt;
&lt;head&gt;
  &lt;meta charset=&quot;UTF-8&quot;&gt;
  &lt;title&gt;Belajar jQuery Faizall TM&lt;/title&gt;
  &lt;script src=&quot;jquery-2.1.4.js&quot;&gt;&lt;/script&gt;
  &lt;script&gt;
    $( document ).ready(function() {
      $( &quot;#tombol_hide&quot; ).click(function() {     
        $(&quot;h1&quot;).hide();
      });
      
      $( &quot;#tombol_show&quot; ).click(function() {     
        $(&quot;h1&quot;).show();
      });
      
      $( &quot;#tombol_small&quot; ).click(function() {     
        $(&quot;h1&quot;).css(&quot;font-size&quot;,&quot;20px&quot;);
      });
      
      $( &quot;#tombol_red&quot; ).click(function() {     
        $(&quot;h1&quot;).css( &quot;color&quot;, &quot;red&quot; );
      });
    });
   &lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;
  &lt;h1&gt;Belajar jQuery di Faizall TM&lt;/h1&gt;
  &lt;button id=&quot;tombol_hide&quot;&gt;Sembunyikan&lt;/button&gt;
  &lt;button id=&quot;tombol_show&quot;&gt;Tampilkan&lt;/button&gt;
  &lt;button id=&quot;tombol_small&quot;&gt;Perkecil&lt;/button&gt;
  &lt;button id=&quot;tombol_red&quot;&gt;Merahkan&lt;/button&gt;
&lt;/body&gt;
&lt;/html</code></pre>

              
            
!

CSS

              
                /* Syntax Ala Igniel by Faizall TM */
.post-body pre,#comments pre{background-color:#292E34;border-left:5px solid #008c5f;padding:0;margin:.5em auto;position:relative;white-space:pre;word-wrap:break-word;word-break:normal;overflow:auto;-moz-tab-size:2;-o-tab-size:2;tab-size:2;user-select:text;-webkit-user-select:text;-khtml-user-select:text;-moz-user-select:text;-ms-user-select:text;user-select:text;-webkit-hyphens:none;-moz-hyphens:none;-ms-hyphens:none;hyphens:none}.post-body pre code,#comments pre code{display:block;color:#BFBF90;font-size:13px;max-height:250px;padding:10px 15px;line-height:1.5em;white-space:pre;overflow:auto;user-select:text;-webkit-user-select:text;-khtml-user-select:text;-moz-user-select:text;-ms-user-select:text;user-select:text}.post-body pre code span{color:#95b2f6;font-style:italic}.post-body pre mark,.post-body code mark,.post-body pre code mark{background-color:#95b2f6;color:#292E34;margin:0;padding:0}.post-body code,.post-body code.tutor{color:#d85555;letter-spacing:-.3px;font-size:1em;user-select:text;-webkit-user-select:text;-khtml-user-select:text;-moz-user-select:text;-ms-user-select:text;user-select:text}.post-body pre.html:before,.post-body pre.css:before,.post-body pre.javascript:before,.post-body pre.jquery:before{background-color:#bde0b9;font:500 14px 'Google Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Oxygen', 'Roboto', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', Arial, sans-serif;color:#333333;display:block;padding:10px 35px;font-size:16px;background-repeat:no-repeat;background-size:20px 20px;background-position-x:7px;background-position-y:center}.post-body pre.html:before{content:'HTML';background-image:url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12,17.56L16.07,16.43L16.62,10.33H9.38L9.2,8.3H16.8L17,6.31H7L7.56,12.32H14.45L14.22,14.9L12,15.5L9.78,14.9L9.64,13.24H7.64L7.93,16.43L12,17.56M4.07,3H19.93L18.5,19.2L12,21L5.5,19.2L4.07,3Z' fill='%231d2129'/%3E%3C/svg%3E")}.post-body pre.css:before{content:'CSS';background-image:url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M5,3L4.35,6.34H17.94L17.5,8.5H3.92L3.26,11.83H16.85L16.09,15.64L10.61,17.45L5.86,15.64L6.19,14H2.85L2.06,18L9.91,21L18.96,18L20.16,11.97L20.4,10.76L21.94,3H5Z' fill='%231d2129'/%3E%3C/svg%3E")}.post-body pre.javascript:before{content:'Javascript';background-image:url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M3,3H21V21H3V3M7.73,18.04C8.13,18.89 8.92,19.59 10.27,19.59C11.77,19.59 12.8,18.79 12.8,17.04V11.26H11.1V17C11.1,17.86 10.75,18.08 10.2,18.08C9.62,18.08 9.38,17.68 9.11,17.21L7.73,18.04M13.71,17.86C14.21,18.84 15.22,19.59 16.8,19.59C18.4,19.59 19.6,18.76 19.6,17.23C19.6,15.82 18.79,15.19 17.35,14.57L16.93,14.39C16.2,14.08 15.89,13.87 15.89,13.37C15.89,12.96 16.2,12.64 16.7,12.64C17.18,12.64 17.5,12.85 17.79,13.37L19.1,12.5C18.55,11.54 17.77,11.17 16.7,11.17C15.19,11.17 14.22,12.13 14.22,13.4C14.22,14.78 15.03,15.43 16.25,15.95L16.67,16.13C17.45,16.47 17.91,16.68 17.91,17.26C17.91,17.74 17.46,18.09 16.76,18.09C15.93,18.09 15.45,17.66 15.09,17.06L13.71,17.86Z' fill='%231d2129'/%3E%3C/svg%3E")}.post-body pre.jquery:before{content:'jQuery';background-image:url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M22.88,10.41C20.77,12.18 17.61,11.9 15.84,9.79C14.06,7.67 14.34,4.5 16.45,2.75L16.96,2.37C15.27,4.19 15.16,7.03 16.8,9C18.43,10.94 21.25,11.32 23.34,9.97L22.88,10.41M21.1,14.5C17.93,17.17 13.2,16.76 10.54,13.58C7.87,10.41 8.29,5.68 11.46,3L12.38,2.36C9.96,5.09 9.84,9.26 12.26,12.14C14.68,15 18.8,15.63 21.91,13.72L21.1,14.5M19.97,19.38C15.53,23.11 8.9,22.53 5.17,18.08C1.45,13.64 2.03,7 6.47,3.29L7.58,2.5C4.07,6.3 3.85,12.23 7.28,16.32C10.71,20.4 16.59,21.22 20.96,18.43L19.97,19.38Z' fill='%231d2129'/%3E%3C/svg%3E")}
              
            
!

JS

              
                
              
            
!
999px

Console