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

              
                <div class="nav">
  <img src="https://statsig.com/images/logo_wordmark.svg" class="logo" />
  <div>
    <ul class="links">
      <li>Docs</li>
      <li>Blog</li>
      <li>Pricing</li>
    </ul>
  </div>
</div>
<!-- 
Here is the placeholder we will populate with DynamicConfig data
-->
<div id="homepageBanner">
</div>
<!-- Remainder of the webpage below -->
<div class="content">
  <div class="hero">
    <div>
      <h1>Ship faster</h1>
      <h3>Safely and confidently</h3>
      <p>Stop endless product debates and expensive ship mistakes. Use data to make decisions, and ship just the right features!</p>
    </div>
    <div>
      <img src="https://statsig.com/images/macbook.png" class="laptop" />
    </div>
  </div>
  <div>
              
            
!

CSS

              
                #homepageBanner {
  background-color: 'black';
  width: 100%;
  height: 40px;
  margin-bottom: 40px;
  color: white;
  text-align: center;
  line-height: 40px;
  display: none;
}


/* Remainder of the webpage styles below */

body {
  font-family: "Montserrat", Helvetica, "Segoe UI", sans-serif;
  color: #3b3b3b;
  padding-left: 20px;
}

.nav {
  display: flex;
  justify-content: space-between;
  margin-bottom: 40px;
}

.logo {
  width: 200px;
}

.links {
  align-items: center;
  display: flex;
  list-style: none;
  flex-direction: row;
}

.links > li {
  font-size: 14px;
  margin-right: 60px;
}

.content {
  width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.hero {
  display: flex;
}

.laptop {
  width: 400px;
}

              
            
!

JS

              
                var script = document.createElement("script");
script.addEventListener("load", async function (event) {
  await statsig.initialize("client-QQXdlVHEEyeTx7EkKKWy7EnWkohhTxVgAHU4nj5USwr");
  const bannerConfig = statsig.getConfig("banner_config");
  const text = bannerConfig.get("text", null);
  const backgroundColor = bannerConfig.get("backgroundColor", "black");
  const color = bannerConfig.get("color", "white");
  const fontSize = bannerConfig.get("fontSize", 14);
  if (text == null) {
    return;
  }
  const banner = document.getElementById("homepageBanner");
  const bannerText = document.createElement("p");
  banner.style.display = 'block';
  bannerText.innerHTML = text;
  banner.style.color = color;
  banner.style.fontSize = fontSize + "px";
  banner.style.backgroundColor = backgroundColor;
  banner.appendChild(bannerText);
});

// Loading the SDK
script.src =
  "https://cdn.jsdelivr.net/npm/statsig-js@2.0.3/dist/statsig-prod-web-sdk.min.js";
script.async = true;
document.getElementsByTagName("body")[0].parentNode.appendChild(script);

              
            
!
999px

Console