Pen Settings

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

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

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

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

Code Indentation


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.

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.

              <div class="broadcast">
  <div class="container">📝 Help improve Affinicasts by taking a short survey. <a href="https://andyleverenz1.typeform.com/to/vdwDSK" target="_blank">Add your response</a>

  <div class="hide-broadcast">
    <a href="#" class="hide-broadcast-target">
        <svg width="20" height="20" viewBox="0 0 20 20"><path d="M10.707 10.5l5.646-5.646a.5.5 0 0 0-.707-.707L10 9.793 4.354 4.147a.5.5 0 0 0-.707.707L9.293 10.5l-5.646 5.646a.5.5 0 0 0 .708.707l5.646-5.646 5.646 5.646a.498.498 0 0 0 .708 0 .5.5 0 0 0 0-.707L10.709 10.5z"></path></svg>

<div class="moar-content container">
    Lorem ipsum dolor sit amet consectetur adipisicing elit. Maiores dolorem ea similique ullam, ipsam explicabo facere facilis, quibusdam cupiditate suscipit eaque commodi alias sint? Minus consequuntur deleniti quas quia nesciunt.

  <p>Lorem ipsum dolor sit, amet consectetur adipisicing elit. Consequatur nemo unde dignissimos dolore vitae provident optio molestiae excepturi quae fugiat nisi libero nulla, nesciunt repellat odio quia ullam? Sequi, voluptate.</p>
               @import url('https://fonts.googleapis.com/css?family=Muli');

$brand-secondary: #F3B823;
$text-color: #444;

* {
  margin: 0; 
  padding: 0;

.container {
  max-width: 1170px;
  margin: 0 auto;

.broadcast {
  padding: .6rem 0;
  color: white;
  display: flex;
  text-align: center;
  font-family: 'Muli', sans-serif;

.broadcast {
  background: #444;
  position: relative;
  font-weight: bold;

  a {
    color: $brand-secondary;
    text-decoration: none;

  .hide-broadcast {
    position: absolute;
    right: 20px;
    top: 3px;

    svg {
      fill: white;
      width: 20px;
      height: 20px;
      position: relative;
      top: 2px;

    .hide-broadcast-target {
      width: 24px;
      height: 24px;
      display: inline-block;
      border-radius: 50%;
      padding: 4px;
      transition: all ease .3s;

    &:hover {
      .hide-broadcast-target {
        background: rgba(white, .9);
        svg { fill: $text-color; }

.moar-content {
  padding: 3rem 0;
  font-size: 16px;
  font-family: "Muli", sans-serif;
  p {
    margin-bottom: 1.6rem;
              /* Let's Build: With JavaScript - Web-Crunch.com
   Subscribe on YouTube - https://youtube.com/c/webcrunch
   Let's Build: Broadcast Bar with Cookie Support 

var broadcast = document.querySelector('.broadcast');
var closeBroadcast = document.querySelector('.hide-broadcast-target');
var cookie = readCookie('hide_broadcast_bar');

broadcast.style.display = "none";

if (cookie == "true") {
  broadcast.style.display = "none";

closeBroadcast.addEventListener('click', function(e) {
  if(cookie != "true") {
    broadcast.style.display = "none";
    createCookie('hide_broadcast_bar', "true", 7);

function createCookie(name, value, days) {
  if(days) {
    var date = new Date();
    date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000));
    var expires = "; expires=" + date.toGMTString();
  } else var expires = "";
  document.cookie = name + "=" + value + expires + "; path=/"

function readCookie(name) {
  var nameEQ = name + "=";
  var ca = document.cookie.split(';');
  for (var i = 0; i < ca.length; i++) {
    var c = ca[i];
    while (c.charAt(0) == ' ') c = c.substring(1, c.length);
    if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length, c.length);
  return null;

function eraseCookie(name) {
  createCookie(name, "", -1);

🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.