Add following snippets into your html header

<header>
   <!-- some other things here -->
   <link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.0.0/styles/solarized-dark.min.css">
   <script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.0.0/highlight.min.js"></script>
   <script type="text/javascript">
     hljs.initHighlightingOnLoad();
   </script>
</header>

You can pick one theme(syntax hightlight scheme) from https://github.com/isagalaev/highlight.js/tree/master/src/styles

Then wrap your code into <pre><code> tags.

example:

<pre><code>
int a = 5;
console.log(a)
</code></pre>