Search
 
SCRIPT & CODE EXAMPLE
 

HTML

highlightjs

<!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>
Comment

highlight js

<!DOCTYPE html>
<html lang="en">

    <head>
        <title>HighLight Js 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>
        <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous">
        <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/js/bootstrap.bundle.min.js" integrity="sha384-MrcW6ZMFYlzcLA8Nl+NtUVF0sA7MsXsP1UyJoMp4YLEuNSfAP+JcXn/tWtIaxVXM" crossorigin="anonymous"></script>
        <script src="//cdnjs.cloudflare.com/ajax/libs/highlightjs-line-numbers.js/2.8.0/highlightjs-line-numbers.min.js"></script>
        <!-- and it's easy to individually load additional languages like go.min.js-->
        <script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.5.1/languages/csharp.min.js"></script>
        <!-- add custom theme agate.min.css all referenced from hljs-->
        <link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/10.0.3/styles/vs2015.min.css">
        <Style>
            /* for block of numbers */
            .hljs-ln-numbers {
                -webkit-touch-callout: none;
                -webkit-user-select: none;
                -khtml-user-select: none;
                -moz-user-select: none;
                -ms-user-select: none;
                user-select: none;

                text-align: left;
                color: rgb(255, 255, 255);
                border-right: 3px solid rgb(255, 255, 255);
                vertical-align: top;
                padding-right: 5px;

                /* your custom style here */
            }

            /* for block of code */
            .hljs-ln-code {
                padding-right: 10px;
            }

            .hljs-ln td {
                padding-top: px;
                padding-right: 5px;
                padding-bottom: px;
                padding-left: 5px;
            }
        </Style>
    </head>

    <body>
        <h2>C Sharp highlight</h2>
        <div class="d-inline-flex p-2 bd-highlight">
            <pre>
                <code class="csharp rounded  shadow-sm p-3 mb-5">class Program
{
    static void Main(string[] args)
    {
        //var s = "Example Case of hljs As of date 10 Nov 2022";
        var h = new int[] { 4, 2, 0, 3, 2, 5 };
        var obj = new Program();
        Console.WriteLine(string.Join(" ",h));
    }
}
                </code>
            </pre>
        </div>
        <script>
            hljs.initHighlightingOnLoad();
            hljs.initLineNumbersOnLoad();
        </script>
    </body>

</html>
Comment

highlight.js

<link rel="stylesheet"
      href="//cdn.jsdelivr.net/gh/highlightjs/cdn-release@10.0.3/build/styles/default.min.css">
<script src="//cdn.jsdelivr.net/gh/highlightjs/cdn-release@10.0.3/build/highlight.min.js"></script>
Comment

highlight js

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

highlight.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
Comment

PREVIOUS NEXT
Code Example
Html :: html 5 
Html :: What is the correct HTML element for playing audio files? 
Html :: how to automatic get boilerplate code for html in vc code 
Html :: bootstrap news template 
Html :: vscode format html on save 
Html :: tailwind rotate 180 
Html :: how to download in html 
Html :: dark mode favicon 
Html :: click on a button and start downloading data html 
Html :: html add image from folder 
Html :: fa icon person 
Html :: inline vuetify 
Html :: Align an element to bottom with flexbox 
Html :: onclick on anchor tag 
Html :: html writing shortcuts 
Html :: how to add underline in markdown 
Html :: vue bootstrap row 
Html :: html script element 
Html :: print button html 
Html :: how to add css file in wordpress 
Html :: bootstrap soft corner 
Html :: ion icon image 
Html :: innerhtml angular 
Html :: how to increaase font size on html 
Html :: index.html file 
Html :: invisible element html 
Html :: python print html as a string 
Html :: Text displayed over an image 
Html :: using svg in html 
Html :: how to use unicode in html 
ADD CONTENT
Topic
Content
Source link
Name
6+9 =