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 includes JSX processing.

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

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

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.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

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

Visit your global Editor Settings.

HTML

              
                <!doctype html>
<html>

<head>
  <!-- cookie banner custom styles (just for demo purposes) -->
  <style type="text/css">
    #iubenda-cs-banner.iubenda-cs-default .custom-wrapper {
      max-width: 640px !important;
      margin: auto !important;
    }

    #iubenda-cs-banner.iubenda-cs-default .iubenda-cs-content {
      background: rgb(5, 40, 98) !important;
      color: #fff !important;
    }

    #iubenda-cs-banner.iubenda-cs-default .iubenda-cs-content {
      padding: 20px !important;
    }

    #iubenda-cs-banner.iubenda-cs-default .iubenda-cs-content h4 {
      line-height: 1 !important;
      margin: 0 !important;
    }

    #iubenda-cs-banner.iubenda-cs-default .iubenda-cs-content p {
      margin-top: 8px !important;
    }

    #iubenda-cs-banner.iubenda-cs-default .iubenda-cs-content a {
      text-decoration: underline !important;
    }

    #iubenda-cs-banner.iubenda-cs-default .iubenda-cs-content button.iubenda-cs-accept-btn,
    #iubenda-cs-banner.iubenda-cs-default .iubenda-cs-content button.iubenda-cs-customize-btn,
    #iubenda-cs-banner.iubenda-cs-default .iubenda-cs-content button.iubenda-cs-another-btn {
      padding: 10px 20px !important;
      margin: 5px 10px 5px 0 !important;
      border: 0 !important;
      font-weight: 600 !important;
      color: #fff !important;
      background: rgb(80, 105, 145) !important;
      transition: all .3s ease !important;
      cursor: pointer !important;
    }

    #iubenda-cs-banner.iubenda-cs-default .iubenda-cs-content button.iubenda-cs-accept-btn {
      color: rgb(5, 40, 98) !important;
      background: rgb(235, 235, 235) !important;
    }

    #iubenda-cs-banner.iubenda-cs-default .iubenda-cs-content button:hover,
    #iubenda-cs-banner.iubenda-cs-default .iubenda-cs-content button:active {
      opacity: .85 !important;
    }
  </style>

  <!-- cookie banner scripts -->
  <script type="text/javascript">
    var _iub = _iub || [];
    _iub.csConfiguration = {
      "lang": "en",
      "siteId": 896537, //use your siteId
      "cookiePolicyId": 8207462, //use your cookiePolicyId
      "consentOnContinuedBrowsing": false, //avoid consent to be given on continued browsing
      //"perPurposeConsent": true,
      //"purposes": "1, 2, 3, 4, 5, 6, 7", //Uncomment to customize which purposes to display (by default, we use the purposes from the cookie policy connected to your configuration)
      "banner": {
        "content": "<h4>Are you happy to accept cookies?</h4><p>We use cookies to make our site work. Find out more in our %{cookie_policy_link}.</p>",
        "html": "<div class='iubenda-cs-container'><div class='iubenda-cs-content'>" + "<div class='custom-wrapper'>" + "<div>%{banner_content}</div>" + "<div class='buttons'>" + "<button class='iubenda-cs-accept-btn'>Yes, I'm happy</button>" + "<button class='iubenda-cs-customize-btn'>Manage my cookies</button>" + "<button class='iubenda-cs-another-btn'>Custom button (inactive)</button>" + "</div>" + "</div>" + "</div>" + "</div>"
      }
    };
  </script>
  <script type="text/javascript" src="//cdn.iubenda.com/cs/iubenda_cs.js" charset="UTF-8" async></script>
</head>

<body>
  <header>
    <div class="wrapper">
      <h1>iubenda Cookie Solution</h1>
      <p>Cookie banner with custom HTML and content</p>
    </div>
  </header>

  <section class="wrapper">

    <p>In this demo we've used <code>banner.html</code> and <code>banner.content</code> to customize the HTML and content of the cookie banner. Head to our <a href="https://www.iubenda.com/en/help/1205#banner-content" target="_blank">advanced guide</a> to learn more about these parameters and the shortcodes you can use.</p>

    <div class="note">
      <ul>
        <li>Remember to use your own credentials from <a href="https://www.iubenda.com/en/dashboard" target="_blank">your iubenda account</a></li>
        <li>This is a sample for pure demonstrative purposes, <strong>no consents are saved</strong> (result of <code>_iub.csConfiguration.skipSaveConsent = true</code>). Just refresh the page to make the cookie banner reappear.</li>
      </ul>
    </div>

    <h3>Block cookies prior to consent</h3>

    <p>To demonstrate the cookie blocking feature, we've embed a YouTube video:</p>

    <div class="embed-container" -->
      <!-- please note type="text/plain" class="_iub_cs_activate" data-suppressedsrc="..." (manual tagging) -->
      <iframe type="text/plain" class="_iub_cs_activate" width="560" height="315" data-suppressedsrc="https://www.youtube.com/embed/DS7bqHoz8Ic" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
    </div>

    <p>And a Twitter follow button:</p>

    <!-- please note type="text/plain" class="_iub_cs_activate" data-suppressedsrc="..." (manual tagging) -->
    <a href="https://twitter.com/iubenda" class="twitter-follow-button" data-show-count="true" data-size="large">Follow @iubenda</a>
    <script async type="text/plain" class="_iub_cs_activate" data-suppressedsrc="https://platform.twitter.com/widgets.js" charset="utf-8"></script>

    <p>Both scripts are blocked through manual tagging, one of the <a href="https://www.iubenda.com/en/help/3081" target="_blank">methods available</a> with the Cookie Solution. Click on the <strong>Accept</strong> button to release these scripts (refresh the page to return to the starting point).</p>

    <!--a href="#" class="iubenda-advertising-preferences-link btn">Update your advertising tracking preferences</a-->

    <hr />

    <h4>Helpful guides</h4>
    <ul class="guides">
      <li><a href="https://www.iubenda.com/en/help/1177" target="_blank">Cookie Solution - Getting Started</a></li>
      <li><a href="https://www.iubenda.com/en/help/3831" target="_blank">How to Customize the Look and Behavior of the Cookie Banner (Beginner's Guide)</a></li>
      <li><a href="https://www.iubenda.com/en/help/1205" target="_blank">How to Configure Your Cookie Solution (Advanced Guide)</a></li>
      <li><a href="https://www.iubenda.com/en/help/3081" target="_blank">Introduction to the Prior Blocking of Cookies</a></li>
    </ul>

  </section>
</body>

</html>
              
            
!

CSS

              
                
              
            
!

JS

              
                //don't copy this JS (just for demo purposes)

//don't save consent, always show the banner
_iub.csConfiguration.skipSaveConsent = true;
              
            
!
999px

Console