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.

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

              
                <h1>
  Backer Rewards
</h1>

<p class="disclosure">
  <small>Download speed estimates are based on the average reported <abbr title="Internet Service Provider">ISP</abbr> speeds for your general area.</small>
</p>

<section class="rewards" aria-label="Rewards">
  <div class="download">
    <p>
      <a download href="movie.mov">Download movie</a>
    </p>
    <p class="download__instructions">
      <small>Typically takes 30&ndash;45 minutes.</small>
      <small class="download__properties">2.4 <abbr title="Gigabytes">GB</abbr> AVI</small>
    </p>
  </div>

  <div class="download">
    <p>
      <a download href="theme-song.mp3">Download theme song</a>
    </p>
    <p class="download__instructions">
      <small>Typically takes 15&ndash;30 seconds.</small>
      <small class="download__properties">4.5 <abbr title="Megabytes">MB</abbr> MP3</small>
    </p>
  </div>

  <div class="download">
    <p>
      <a download href="script.txt">Download script</a>
    </p>
    <p class="download__instructions">
      <small>Typically takes 5&ndash;10 seconds.</small>
      <small class="download__properties">1.28 <abbr title="Kilobytes">KB</abbr> TXT</small>
    </p>
  </div>

  <div class="download">
    <p>
      <a download href="press-kit.zip">Download press kit</a>
    </p>
    <p class="download__instructions">
      <small>Typically takes 1&ndash;3 minutes.</small>
      <small class="download__properties">230 <abbr title="Megabytes">MB</abbr> zip</small>
    </p>
  </div>

  <div class="download">
    <p>
      <a download href="podcast.m4a">Download podcast</a>
    </p>
    <p class="download__instructions">
      <small>Typically takes 1&ndash;3 minutes.</small>
      <small class="download__properties">12 <abbr title="Megabytes">MB</abbr> M4A</small>
    </p>
  </div>

  <div class="download">
    <p>
      <a download href="models.stl">Download 3D models</a>
    </p>
    <p class="download__instructions">
      <small>Typically takes 30&ndash;45 seconds.</small>
      <small class="download__properties">21.8 <abbr title="Megabytes">MB</abbr> STL</small>
    </p>
  </div>

  <div class="download">
    <p>
      <a download href="manual.pdf">Download manual</a>
    </p>
    <p class="download__instructions">
      <small>Typically takes 1&ndash;2 minutes.</small>
      <small class="download__properties">1.7 <abbr title="Megabytes">GB</abbr> PDF</small>
    </p>
  </div>
  
  <div class="download">
    <p>
      <a download href="support-docs.docx">Download support docs</a>
    </p>
    <p class="download__instructions">
      <small>Typically takes 30 seconds to 1 minute.</small>
      <small class="download__properties">6.4 <abbr title="Megabytes">MB</abbr> docx</small>
    </p>
  </div>
</section>
              
            
!

CSS

              
                // Variables
:root {
  --gray-light: #d9d9d9;
  --gray-mid: #808080;
  --gray-dark: #333333;
  --icon-distance: 1.5rem;
}


// Download styling
a[download] {
  font-size: 1.5rem;
  font-weight: 500;
  padding-left: var(--icon-distance);

  // Pseudo content
  &::before {
    content: url(https://s3-us-west-2.amazonaws.com/s.cdpn.io/11907/download-icon-download.svg); // Fallback icon
    display: inline-block;
    height: 2rem;
    position: relative;
     top: 0.75rem;
     right: var(--icon-distance);
    width: 2rem;
  }
}

// Movies
a[download][href$=".mov"] {
  &::before {
    content: url(https://s3-us-west-2.amazonaws.com/s.cdpn.io/11907/download-icon-movie.svg);
  }
}

// Podcasts
a[download][href$=".m4a"] {
  &::before { content: url(https://s3-us-west-2.amazonaws.com/s.cdpn.io/11907/download-icon-podcast.svg); }
}

// Manuals
a[download][href$=".pdf"] {
  &::before { content: url(https://s3-us-west-2.amazonaws.com/s.cdpn.io/11907/download-icon-manual.svg); }
}

// Soundtrack
a[download][href$=".mp3"] {
  &::before { content: url(https://s3-us-west-2.amazonaws.com/s.cdpn.io/11907/download-icon-music.svg); }
}

// Press Kits
a[download][href$=".zip"] {
  &::before { content: url(https://s3-us-west-2.amazonaws.com/s.cdpn.io/11907/download-icon-zip.svg); }
}

// Scripts
a[download][href$=".txt"] {
  &::before { content: url(https://s3-us-west-2.amazonaws.com/s.cdpn.io/11907/download-icon-script.svg); }
}

// 3D Models
a[download][href$=".stl"] {
  &::before { content: url(https://s3-us-west-2.amazonaws.com/s.cdpn.io/11907/download-icon-3d.svg); }
}

// Support Docs
a[download][href$=".docx"] {
  &::before { content: url(https://s3-us-west-2.amazonaws.com/s.cdpn.io/11907/download-icon-documentation.svg); }
}




// Additional page styling
body {
  color: var(--gray-dark);
  font-family: 'Barlow', sans-serif;
  font-size: 18px;
  margin: 1.5rem 1.5rem 3rem 1.5rem;
  
  // Media Queries
  @media screen and (min-width: 30em) {
    margin: 2rem 2rem 4rem 2rem;
  }
}

p {
  margin: 0;
}

small {
  font-size: 1em;
}

a {
  color: #3477db;
  text-decoration-skip: ink;

  // States
  &:focus,
  &:hover {
    color: #1e90ff;
    text-decoration: none;
  }
  
  &:active {
    color: #1f3a93;
  }
}

abbr[title] {
  border-bottom: 1px dotted;
  cursor: help;
  text-decoration: none;
}

.disclosure {
  margin-bottom: 2em;
}

.rewards {
  // Media Queries
  @media screen and (min-width: 30em) {
    border: 1px solid var(--gray-light);
    border-radius: 0.75rem;
    padding: 1.5rem 2rem 3rem 2rem;

    // Supports
    @supports (display: grid) {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
      grid-auto-rows: minmax(5rem, auto);
      grid-gap: 2rem; 
    }
  }
}

.download {
  margin-top: 2rem;

  // Media Queries
  @media screen and (min-width: 30em) {
    // Supports
    @supports (display: grid) {
      margin-top: 0;  
    }
  }

  &__instructions {
    color: var(--gray-dark);
    line-height: 1.3;
    padding-top: 0.4rem;
    padding-left: 3.6rem;
  }
  
  &__properties {
    color: var(--gray-mid);
    display: block;
    font-size: 80%;
    text-transform: uppercase;
    margin-top: 0.65em;
  }
}

.sr-only {
  border: 0;
  clip: rect(0 0 0 0);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}
              
            
!

JS

              
                
              
            
!
999px

Console