카테고리 없음

highlight.js로 코드 하이라이트 구현하기

decompiler 2017. 9. 26. 09:32
@font-face {
font-family: Chunkfive; src: url('Chunkfive.otf');
}
 
body, .usertext {
color: #F0F0F0; background: #600;
font-family: Chunkfive, sans;
}
 
@import url(print.css);
@media print {
a[href^=http]::after {
content: attr(href)
}
}

https://highlightjs.org/download/

여기에서 파일 다운받아서 highlight.pack.js 와 css 파일 업로드 후 head 에 

<link rel="stylesheet" href="./images/androidstudio.css">
<script src="./images/highlight.pack.js"></script>
<script>hljs.initHighlightingOnLoad();</script>

넣으심 됩니다.

<pre><code>
입력은 여기에 html 로 넣으심됩니다. 연습
</code></pre>