Pasang Syntax Highlighter Dengan Number

Cara Pasang Syntax Highlighter Dengan Number
Please wait 0 seconds...
Scroll Down and click on Go to Link for destination
Congrats! Link is Generated
Syntax Highlighter

siang Bro , kali ini saya mau bagi TUTORIAL cara pasang syntax Highlighter dengan number , syntax highlighter juga berfungsi sebagai pembungkus markup,javascript, dan css tag dengan memberikan warna pada setiap tag tersebut. sekarang mari perhatikan cara pemasangan pada blogger

pertama kita tambahkan CSS terlebih dahulu ke ]]> </ b: skin> atau <style> .
Contoh ada pada Agiel Triono

.hljs{display:block;overflow-x:auto;padding:0 !important;background:#222;color:white}
.hljs a{color:inherit}
.hljs a:focus,.hljs a:hover{color:inherit;text-decoration:underline}
code {padding: 0;font-size: inherit;color: inherit;white-space: pre !important;}
pre .line-number{color:#666666;min-width:1em}
pre .line-number span{display:block;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;}
pre .line-number span:nth-child(even){background-color:#EEEEEE}
pre .cl{display:block;clear:both}
pre .line-number{float:left;border-right:2px solid #666666;text-align:right}
pre .line-number span{padding:0 .8em 0 1em}

lalu CTRLF pada keyboard cari </body>
lalu tambahkan kode di bawah ini tepat di atas kode </body>
<script type='text/javascript'> 
(function() {
    var pre = document.getElementsByTagName('pre'),
        pl = pre.length;
    for (var i = 0; i < pl; i++) {
        pre[i].innerHTML = '<span class="line-number"></span>' + pre[i].innerHTML + '<span class="cl"></span>';
        var num = pre[i].innerHTML.split(/\n/).length;
        for (var j = 0; j < num; j++) {
            var line_num = pre[i].getElementsByTagName('span')[0];
            line_num.innerHTML += '<span>' + (j + 1) + '</span>';
<script type='text/javascript'>
function downloadJSAtOnload(){var e=document.createElement("script");e.src="",document.body.appendChild(e)}window.addEventListener?window.addEventListener("load",downloadJSAtOnload,!1):window.attachEvent?window.attachEvent("onload",downloadJSAtOnload):window.onload=downloadJSAtOnload;
SAVE TEMPLATE. Lihat hasil nya.

Getting Info...

Post a Comment

Agiel Triono Comment Policy

Do not include spam link !
Please read our Comment Policy before commenting.
Cookie Consent
We serve cookies on this site to analyze traffic, remember your preferences, and optimize your experience.
It seems there is something wrong with your internet connection. Please connect to the internet and start browsing again.
AdBlock Detected!
We have detected that you are using adblocking plugin in your browser.
The revenue we earn by the advertisements is used to manage this website, we request you to whitelist our website in your adblocking plugin.
Site is Blocked
Sorry! This site is not available in your country.