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 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.

HTML

              
                <div class="case">
<h1>Flexbox - Normal</h1>
<div class="card case0">
  <div class="row row1">
    <span class="data string1"><h2>6302 E Dr Martin Luther King Jr Blvd</h2></span>
    <span class="count count1"></span>
    <span class="data string2"><h2>133,619sf Office Available</h2>
    <span class="count count2"></span></span>
  </div>
  <div class="row row2">
    <span class="data string3"><h2>Interstate Corporate Center</h2>
    <span class="count count3"></span></span>
    <span class="data string4"><h2>Tampa, FL</h2>
    <span class="count count4"></span></span>
  </div>
  <div class="fade"></div>
</div>
</div>

<div class="case">
<h1>CSS Grid - Normal</h1>
<div class="card case4">
  <div class="grid-container-2">
    <div class="data data-point-1"><h2>6302 E Dr Martin Luther King Jr Blvd</h2></div>
    <div class="data data-point-2"><h2>133,619sf Office Available</h2></div>
    <div class="data data-point-3"><h2>Interstate Corporate Center</h2></div>
    <div class="data data-point-4"><h2>Tampa, FL</h2></div>
  </div>
  <div class="fade"></div>
</div>
</div>

<div class="case">
<h1>Flexbox - Data Points Overlap</h1>
<div class="card case1">
  <div class="row row1">
    <span class="data string1"><h2>5900 183A Toll Rd </h2></span>
    <span class="count count1"></span>
    <span class="data string2"><h2>35,000sf Retail Available For Lease</h2></span>
    <span class="count count2"></span>
  </div>
  <div class="row row2">
    <span class="data string3"><h2>iSports-Fitness Medical Entertainment Retail</h2></span>
    <span class="count count3"></span>
    <span class="data string4"><h2>Cedar Park, TX</h2></span>
    <span class="count count4"></span>
  </div>
  <div class="fade"></div>
</div>
</div>

<div class="case">
<h1>CSS Grid - Data Points Overlap</h1>
<div class="card case4">
  <div class="grid-container-2">
    <div class="data data-point-1"><h2>5900 183A Toll Rd</h2></div>
    <div class="data data-point-2"><h2>35,000sf Retail Available For Lease</h2></div>
    <div class="data data-point-3"><h2>ISports-Fitness Medical Entertainment Retail</h2></div>
    <div class="data data-point-4"><h2>Cedar Park, TX</h2></div>
  </div>
  <div class="fade"></div>
</div>
</div>

<div class="case">
<h1>Flexbox - Data Points Collide & Overlap</h1>
<div class="card case2">
  <div class="row row1">
    <span class="data string1"><h2>6302 E Dr Martin Luther King Jr Blvd</h2></span>
    <span class="count count1"></span>
    <span class="data string2"><h2>133,619sf Office Available For Lease</h2></span>
    <span class="count count2"></span>
  </div>
  <div class="row row2">
    <span class="data string3"><h2>ISports-Fitness Medical Entertainment Retail</h2></span>
    <span class="count count3"></span>
    <span class="data string4"><h2>Cedar Park, TX</h2></span>
    <span class="count count4"></span>
  </div>
  <div class="fade"></div>
</div>
</div>

<div class="case">
<h1>CSS Grid - Data Points Collide & Overlap</h1>
<div class="card case4">
  <div class="grid-container-2">
    <div class="data data-point-1"><h2>6302 E Dr Martin Luther King Jr Blvd</h2></div>
    <div class="data data-point-2"><h2>133,619sf Office Available For Lease</h2></div>
    <div class="data data-point-3"><h2>ISports-Fitness Medical Entertainment Retail</h2></div>
    <div class="data data-point-4"><h2>Cedar Park, TX</h2></div>
  </div>
  <div class="fade"></div>
</div>
</div>

<div class="case">
<h1>Flexbox - 4 Data Points Collide</h1>
<div class="card case3">
  <div class="row row1">
    <span class="data string1"><h2>6302 E Dr Martin Luther King Jr Blvd</h2></span>
    <span class="count count1"></span>
    <span class="data string2"><h2>133,619sf Office Available For Lease</h2></span>
    <span class="count count2"></span>
  </div>
  <div class="row row2">
    <span class="data string3"><h2>ISports-Fitness Medical Entertainment Retail</h2></span>
    <span class="count count3"></span>
    <span class="data string4"><h2>Rancho Santa Margarita, CA</h2></span>
    <span class="count count4"></span>
  </div>
  <div class="fade"></div>
</div>
</div>

<div class="case">
<h1>CSS Grid - 4 Data Points Collide</h1>
<div class="card case4">
  <div class="grid-container-2">
    <div class="data data-point-1"><h2>6302 E Dr Martin Luther King Jr Blvd</h2></div>
    <div class="data data-point-2"><h2>133,619sf Office Available For Lease</h2></div>
    <div class="data data-point-3"><h2>ISports-Fitness Medical Entertainment Retail</h2></div>
    <div class="data data-point-4"><h2>Rancho Santa Margarita, CA</h2></div>
  </div>
  <div class="fade"></div>
</div>
</div>

<div class="case">
<h1>CSS Grid - No Street Address</h1>
<div class="card case4">
  <div class="grid-container">
    <div class="data data-point-1"><h2>ISports-Fitness Medical Entertainment</h2></div>
    <div class="data data-point-2"><h2>133,619sf Office Available</h2></div>
    <div class="data data-point-4"><h2>Carson, CA</h2></div>
  </div>
  <div class="fade"></div>
</div>
</div>

<div class="case">
<h1>CSS Grid - No Street Address, 1 Data Point Collides</h1>
<div class="card case4">
  <div class="grid-container">
    <div class="data data-point-1"><h2>ISports-Fitness Medical Entertainment</h2></div>
    <div class="data data-point-2"><h2>133,619sf Office Available For Lease</h2></div>
    <div class="data data-point-4"><h2>Rancho Santa Margarita, CA</h2></div>
  </div>
  <div class="fade"></div>
</div>
</div>
              
            
!

CSS

              
                body {
  font-family: Helvetica, Arial, sans-serif;
  margin: 0;
  padding: 40px 0 40px 40px;
  background: #f1f1f1;
}

.case {
  float: left;
  margin: 0 40px 0 0;
}

.case h1 {
  font-size: 16px;
  font-weight: 400;
  color: #666;
  margin: 0 0 12px;
  padding: 0;
}

.card {
  background: #fff;
  border: 1px solid #ccc;
  border-bottom: 1px solid #eee;
  margin: 0 0 80px;
  padding: 12px 20px;
  width: 660px;
  box-sizing: border-box;
  position: relative;
}
.card .fade {
  width: 658px;
  height: 60px;
  bottom: -61px;
  background: linear-gradient(to bottom, rgba(255,255,255,1) 0%,rgba(255,255,255,0) 100%); 
  display: block;
  content: "";
  position: absolute;
  left: 0;
}
.card .fade:after, .card .fade:before {
  width: 1px;
  height: 60px;
  top: -1px;
  background: linear-gradient(to bottom, rgba(204,204,204,1) 0%,rgba(204,204,204,0) 100%); 
  display: block;
  content: "";
  position: absolute;
}
.card .fade:after {
  left: -1px;  
}
.card .fade:before {
  right: -1px;
}

.row {
  display: flex;
  justify-content: space-between;
  position: relative;
}

.row1 {
  margin-bottom: 6px;
}

.data {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.data h2 {
  background: none; /* Highlight text area */
  font-size: 19px;
  font-weight: 700;
  margin: 0;
  padding: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-transform: capitalize;
}

.count {
  background: #c00;
  color: #fff;
  font-size: 12px;
  font-weight: 400;
  padding: 3px 5px;
  position: absolute;
  top: -20px;
  display: none; /* Show/hide character counts */
}
.count.count2 {
  right: 0;
}
.count.count3 {
  bottom: -20px;
  top: unset;
}
.count.count4 {
  right: 0;
  bottom: -20px;
  top: unset;
}

.string1 h2, .string3 h2 {
  margin-right: 16px;
}
.string2 h2, .string4 h2 {
  text-align: right;
}

/* Grid */
.grid-container {
  display: grid;
  grid-template-columns: auto auto;
  grid-template-rows: auto auto;
  grid-template-areas: "data-point-1 data-point-2" "data-point-1 data-point-4";
  grid-column-gap: 16px;
  grid-row-gap: 6px;
}
.grid-container-2 {
  display: grid;
  grid-template-columns: auto auto;
  grid-template-rows: auto auto;
  grid-template-areas: "data-point-1 data-point-2" "data-point-3 data-point-4";
  grid-column-gap: 16px;
  grid-row-gap: 6px;
}

.data-point-1 { 
  grid-area: data-point-1;
}
.grid-container .data-point-1 {
  align-self: center;
}
.grid-container .data-point-1 h2 {
  /*font-size: 24px;*/
}

.grid-container .data.data-point-1, .grid-container .data.data-point-1 h2 {
  overflow: auto;
  white-space: normal;
}

.data-point-2 { 
  grid-area: data-point-2;
  text-align: right;
}

.data-point-4 { 
  grid-area: data-point-4; 
  text-align: right;
}
              
            
!

JS

              
                function countString(ex) {
  var i = 1;
  var num = 4;
  while(i<=num) {
    $('.case' + ex + ' .count' + i)
     .html(
        $('.case' + ex + ' .string' + i + ' h2').text().length
      );
    i++;
  }
}

/*
$(document).ready(countString(0));
$(document).ready(countString(1));
$(document).ready(countString(2));
$(document).ready(countString(3));
*/
              
            
!
999px

Console