Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource

JavaScript

Babel is required to process package imports. If you need a different preprocessor remove all packages first.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Behavior

Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

HTML

            
              <!-- Example for HighlighJs Code Badge Component -->
<!-- https://github.com/RickStrahl/highlightjs-badge -->

<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
    
    <meta charset="utf-8">    
    <meta http-equiv="X-UA-Compatible" content="IE=edge">    

    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">

    <link href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet" integrity="sha384-wvfXpqpZZVQGK6TAh5PVlGOfQNHSoD2xbE+QkPxCAFlNEevoEH3Sl0sibVcOQVnN" crossorigin="anonymous">     
  
    <style>
        /* optionally override badge styling */
        .code-badge {
             background: #555 !important;
             padding: 8px !important;
        }
        .code-badge-copy-icon {
            font-size: 1.3em !important;
        }
    </style>
  
</head>
<body>    
<div class="container" style="margin-top: 20px;">
    <div class="float-right" >
    <a href="https://github.com/RickStrahl/highlightjs-badge" target="_blank"><i class="fa fa-github"></i> repo</a></div>
  
  
    <h1>HighlightJS Badge Code Copying Sample </h1>
    <hr>
    
    <h3 class="mt-3">Single line code snippet</h3>
    <pre><code class="hljs language-js">let x = 1;</code></pre>


    <h3 class="mt-3">Larger code snippet</h3>
    
    <pre><code class="hljs language-cs">public static string GetChecksumFromFile(string file)
{
    if (!File.Exists(file))
        return null;

    try
    {
        byte[] checkSum;
        using (FileStream stream = File.Open(file, FileMode.Open, FileAccess.Read, FileShare.Read))
        {
            var md = new MD5CryptoServiceProvider();
            checkSum = md.ComputeHash(stream);
        }

        return StringUtils.BinaryToBinHex(checkSum);
    }
    catch
    {
        return null;
    }
}</code></pre>  


<h3>Auto-Detected</h3>
  
<pre><code>Content-Type: text/html
Accept: application/json
Content-Length: 12332
</code></pre>

    
</div>

<link href="https://unpkg.com/highlightjs-badge/highlightjs/styles/vs2015.css" rel="stylesheet">
<script src="https://unpkg.com/highlightjs-badge/highlightjs/highlight.pack.js"></script>
  
<script src="https://unpkg.com/highlightjs-badge/highlightjs-badge.min.js"></script>
<script>
    setTimeout(function () {
        var pres = document.querySelectorAll("pre>code");
        for (var i = 0; i < pres.length; i++) {
            hljs.highlightBlock(pres[i]);
        }
        var options = {
            contentSelector: "#ArticleBody",
            // Delay in ms used for `setTimeout` before badging is applied
            // Use if you need to time highlighting and badge application
            // since the badges need to be applied afterwards.
            // 0 - direct execution (ie. you handle timing
            loadDelay:0,

            // CSS class(es) used to render the copy icon.
            copyIconClass: "fa fa-copy",
            // CSS class(es) used to render the done icon.
            checkIconClass: "fa fa-check text-success"
        };
        window.highlightJsBadge(options);
    },10);
</script>


<!-- optional customization template -->

<!-- Used in this demo  and styling can be adjusted here -->
<!-- 
<style>
    "@media print {
        .code-badge { display: none; }
    }
    .code-badge-pre {
        position: relative; 
    }
    .code-badge {
        display: flex;
        flex-direction: row;
        white-space: normal;
        background: transparent;
        background: #333;
        color: white;
        font-size: 0.8em;
        opacity: 0.5;
        border-radius: 0 0 0 7px;
        padding: 5px 8px 5px 8px;
        position: absolute;
        right: 0;
        top: 0;
    }
    .code-badge.active {
        opacity: 0.8;
    }
    .code-badge:hover {
        opacity: .95;
    }
    .code-badge a,
    .code-badge a:hover {
        text-decoration: none;
    }

    .code-badge-language {
        margin-right: 10px;
        font-weight: 600;
        color: goldenrod;
    }
    .code-badge-copy-icon {
        font-size: 1.2em;
        cursor: pointer;
        padding: 0 7px;
        margin-top:2;
    }
    .fa.text-success:{ color: limegreen !important}    
</style>
<div id="CodeBadgeTemplate" style="display:none">
    <div class="code-badge">
        <div class="code-badge-language">{{language}}</div>
        <div title="Copy to clipboard">
            <i class="{{copyIconClass}} code-badge-copy-icon"></i>
        </div>
     </div>
</div>
-->
<!-- end customization template -->

</body> 
</html>

            
          
!

CSS

            
              
            
          
!

JS

            
              
            
          
!
999px

Console