“Destaque.js” Respostas de código

Destaquejs

<!DOCTYPE html>
<html lang="en">
<head>
  <title>Bootstrap Example</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.5.1/styles/default.min.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.5.1/highlight.min.js"></script>
<!-- and it's easy to individually load additional languages -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.5.1/languages/go.min.js"></script>
<!-- add custom theme -->
  <link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/10.0.3/styles/vs2015.min.css">
</head>
<body>

  <h2>Python highlight</h2>
    <pre><code class="python">
      def hello_world():
      	return "hello world"
    </code></pre>
      
  <h2>Javascript highlight</h2>
    <pre><code class="javascript">
      function helloWorld(){
      	return "hello world";
      }
	</code></pre>
<script>hljs.initHighlightingOnLoad();</script>
</body>
</html>
Jerome Scott

Destaque.js

<link rel="stylesheet"
      href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/11.2.0/styles/default.min.css">
<script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/11.2.0/highlight.min.js"></script>
Clever Caterpillar

Destaque.js

<link rel="stylesheet"
      href="//cdn.jsdelivr.net/gh/highlightjs/[email protected]/build/styles/default.min.css">
<script src="//cdn.jsdelivr.net/gh/highlightjs/[email protected]/build/highlight.min.js"></script>
Upset Unicorn

Destaque JS

<link rel="stylesheet" href="/path/to/styles/default.css">
<script src="/path/to/highlight.min.js"></script>
<script>hljs.highlightAll();</script>
Undefined

Destaque.js

<link rel="stylesheet"
      href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/10.5.0/styles/default.min.css">
<script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/10.5.0/highlight.min.js"></script>
// FÖr att länka highlightjs till HTML för extra funktioner
Important Ibis

Javascript Destaque elemento

$('body').children().mouseover(function(e){
    $(".hova").removeClass("hova");     
    $(e.target).addClass("hova");
  return false;
}).mouseout(function(e) {
    $(this).removeClass("hova");
});
Important Ibis

Procure respostas de código populares por idioma

Procurar outros idiomas de código