octocatstartv

Pen Settings

CSS Base

Vendor Prefixing

Add External CSS

These stylesheets will be added in this order and before the code you write in the CSS editor. You can also add another Pen here, and it will pull the CSS from it. Try typing "font" or "ribbon" below.

Quick-add: + add another resource

Add External JavaScript

These scripts will run in this order and before the code in the JavaScript editor. You can also link to another Pen here, and it will run the JavaScript from it. Also try typing the name of any popular library.

Quick-add: + add another resource

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.

            
              <section class="performance-facts">
  <header class="performance-facts__header">
    <h1 class="performance-facts__title">Performance Facts</h1>
    <p>Serving Size 1 website
    <p>Servings Per Refresh 1</p>
  </header>
  <table class="performance-facts__table">
    <thead>
      <tr>
        <th colspan="3" class="small-info">
          Amount Per Serving
        </th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <th colspan="2">
          <b>Total Page Size</b>
          822 KB
        </th>
        <td>
          Requests
          56
        </td>
      </tr>
      <tr>
        <td class="blank-cell">
        </td>
        <th>
          Cached Size
          34 KB
        </th>
        <td>
          Requests
          38
        </td>
      </tr>
      <tr class="thick-row">
        <td colspan="3" class="small-info">
          <b>% Per Load *</b>
        </td>
      </tr>
      <tr>
        <th colspan="2">
          <b>Document</b> 27 KB
          
        </th>
        <td>
          <b>3%</b>
        </td>
      </tr>
      <tr>
        <th colspan="2">
          <b>Images (15)</b>
          533 KB
        </th>
        <td>
          <b>52%</b>
        </td>
      </tr>
      <tr>
        <td class="blank-cell">
        </td>
        <th>
          SVG
          (1, inline)
        </th>
        <td>
          
        </td>
      </tr>
      <tr>
        <td class="blank-cell">
        </td>
        <th>
          Retina Hero Images
          (1)
          84 KB
        </th>
        <td>
          8%
        </td>
      </tr>
      <tr>
        <th colspan="2">
          <b>CSS (6)</b>
          13.3 KB
        </th>
        <td>
          <b>1%</b>
        </td>
      </tr>
      <tr>
        <th colspan="2">
          <b>Fonts (13)</b>
          6.7 KB
        </th>
        <td>
          <b>1%</b>
        </td>
      </tr>
      <tr>
        <th colspan="2">
          <b>JavaScript (13)</b>
          86 KB
        </th>
        <td>
          <b>8%</b>
        </td>
      </tr>
      <tr class="thick-end">
        <td class="blank-cell">
        </td>
        <th>
          Libraries / Third-Party (9)
          
        </th>
        <td>
        </td>
      </tr>
    </tbody>
  </table>
  
  <table class="performance-facts__table--grid">
    <tbody>
      <tr>
        <td colspan="2">
          Original Content
          18%
        </td>
        <td>
          Branding
          5%
        </td>
      </tr>
      <tr class="thin-end">
        <td colspan="2">
          Advertising
          10%
        </td>
        <td>
          Navigation
          4%
        </td>
      </tr>
    </tbody>
  </table>
  
  <p class="small-info">* Values are based on an average 1 MB website. Your daily values may be higher or lower depending on your business needs:</p>
  
  <table class="performance-facts__table--small small-info">
    <thead>
      <tr>
        <td colspan="2"></td>
        <th>Size:</th>
        <th>750 KB</th>
        <th>1 MB</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <th colspan="2">Total Size</th>
        <td>Less than</td>
        <td>750 KB</td>
        <td>1 MB</td>
      </tr>
      <tr>
        <td class="blank-cell"></td>
        <th>Advertising</th>
        <td>Less than</td>
        <td>75 KB</td>
        <td>100 KB</td>
      </tr>
      <tr>
        <th colspan="2">Images</th>
        <td>Less than</td>
        <td>250 KB</td>
        <td>350 KB</td>
      </tr>
      <tr>
        <th colspan="2">CSS</th>
        <td>Less than</td>
        <td>75 KB</td>
        <td>100 KB</td>
      </tr>
      <tr>
        <th colspan="3">JavaScript</th>
        <td>150 KB</td>
        <td>200 KBg</td>
      </tr>
      <tr>
        <td class="blank-cell"></td>
        <th colspan="2">Third-Party</th>
        <td>25 KB</td>
        <td>35 KB</td>
      </tr>
    </tbody>
  </table>
  
  <p class="small-info">
    In case it isn't obvious, this entire thing is very tounge-in-cheek. Don't take it too seriously.
  </p>
  
</section>
            
          
!
            
              @import "compass/css3";

body {
  font-size: small;
  line-height: 1.4;
}
p {
  margin: 0;
}

.performance-facts {
  border: 1px solid black;
  margin: 20px;
  float: left;
  width: 320px;
  padding: 0.5rem;
  table {
    border-collapse: collapse;
  }
}
.performance-facts__title {
  font-weight: bold;
  font-size: 2rem;
  margin: 0 0 0.25rem 0;
}
.performance-facts__header {
  border-bottom: 10px solid black;
  padding: 0 0 0.25rem 0;
  margin: 0 0 0.5rem 0;
  p {
    margin: 0;
  }
}
.performance-facts__table {
  width: 100%;
  thead tr {
    th, td {
      border: 0;
    }
  }
  th, td {
    font-weight: normal;
    text-align: left;
    padding: 0.25rem 0;
    border-top: 1px solid black; 
    white-space: nowrap;
  }
  td {
    &:last-child {
      text-align: right;
    }
  }
  .blank-cell {
    width: 1rem;
    border-top: 0;
  }
  .thick-row {
    th, td {
      border-top-width: 5px;
    }
  }
}
.small-info {
  font-size: 0.7rem;
}

.performance-facts__table--small {
  @extend .performance-facts__table;
  border-bottom: 1px solid #999;
  margin: 0 0 0.5rem 0;
  thead {
    tr {
      border-bottom: 1px solid black; 
    }
  }
  td {
    &:last-child {
      text-align: left;
    }
  }
  th, td {
    border: 0;
    padding: 0;
  }
}

.performance-facts__table--grid {
  @extend .performance-facts__table;
  margin: 0 0 0.5rem 0;
  td {
    &:last-child {
      text-align: left;
      &::before {
        content: "•";
        font-weight: bold;
        margin: 0 0.25rem 0 0;
      }
    }
  }
}

.thick-end {
  border-bottom: 10px solid black;
}
.thin-end {
  border-bottom: 1px solid black;
}
            
          
!
999px
Close

Asset uploading is a PRO feature.

As a PRO member, you can drag-and-drop upload files here to use as resources. Images, Libraries, JSON data... anything you want. You can even edit them anytime, like any other code on CodePen.

Go PRO

Loading ..................

Console