Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ 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

Auto Save

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="root">
  <div class="list">
    <div class="card">
      <div class="pic"></div>
      <div class="content">
        <span class="title">He went such dare good mr fact. The small own seven saved man age no offer.</span>
        <span class="descr">He went such dare good mr fact. The small own seven saved man age no offer. Suspicion did mrs nor furniture smallness. Scale whole downs often leave not eat. An expression reasonably cultivated indulgence mr he surrounded instrument. Gentleman eat and consisted are pronounce distrusts.</span>
        </div>
    </div>
    
    <div class="card">
      <div class="pic"></div>
      <div class="content">
        <span class="title">He went such dare good mr fact. The small own seven saved man age no offer.</span>
        <span class="descr">He went such dare good mr fact. The small own seven saved man age no offer. Suspicion did mrs nor furniture smallness. Scale whole downs often leave not eat. An expression reasonably cultivated indulgence mr he surrounded instrument. Gentleman eat and consisted are pronounce distrusts.</span>
        </div>
    </div>
    
    <div class="card">
      <div class="pic"></div>
      <div class="content">
        <span class="title">He went such dare good mr fact. The small own seven saved man age no offer.</span>
        <span class="descr">He went such dare good mr fact. The small own seven saved man age no offer. Suspicion did mrs nor furniture smallness. Scale whole downs often leave not eat. An expression reasonably cultivated indulgence mr he surrounded instrument. Gentleman eat and consisted are pronounce distrusts.</span>
        </div>
    </div>
    
    <div class="card">
      <div class="pic"></div>
      <div class="content">
        <span class="title">He went such dare good mr fact. The small own seven saved man age no offer.</span>
        <span class="descr">He went such dare good mr fact. The small own seven saved man age no offer. Suspicion did mrs nor furniture smallness. Scale whole downs often leave not eat. An expression reasonably cultivated indulgence mr he surrounded instrument. Gentleman eat and consisted are pronounce distrusts.</span>
        </div>
    </div>
    
    <div class="card">
      <div class="pic"></div>
      <div class="content">
        <span class="title">He went such dare good mr fact. The small own seven saved man age no offer.</span>
        <span class="descr">He went such dare good mr fact. The small own seven saved man age no offer. Suspicion did mrs nor furniture smallness. Scale whole downs often leave not eat. An expression reasonably cultivated indulgence mr he surrounded instrument. Gentleman eat and consisted are pronounce distrusts.</span>
        </div>
    </div>
    
    <div class="card">
      <div class="pic"></div>
      <div class="content">
        <span class="title">He went such dare good mr fact. The small own seven saved man age no offer.</span>
        <span class="descr">He went such dare good mr fact. The small own seven saved man age no offer. Suspicion did mrs nor furniture smallness. Scale whole downs often leave not eat. An expression reasonably cultivated indulgence mr he surrounded instrument. Gentleman eat and consisted are pronounce distrusts.</span>
        </div>
    </div>
    
    <div class="card">
      <div class="pic"></div>
      <div class="content">
        <span class="title">He went such dare good mr fact. The small own seven saved man age no offer.</span>
        <span class="descr">He went such dare good mr fact. The small own seven saved man age no offer. Suspicion did mrs nor furniture smallness. Scale whole downs often leave not eat. An expression reasonably cultivated indulgence mr he surrounded instrument. Gentleman eat and consisted are pronounce distrusts.</span>
        </div>
    </div>
  </div>
  <div class="body">
    Body
  </div>
</div>
              
            
!

CSS

              
                .root{
  display: flex;
  border: 1px solid black;
  height: 500px;
  
  .list{
    width: 30%;
    
    .card{
      display: flex;
      border: 1px solid blue;
      padding: 1rem;
      
      .pic{
        width: 100px;
        border: 1px solid green;
      }
      
      .content{
        flex: 1;
        margin-left: 0.5rem;
        // we can use min-width and overflow to fix width issue
        // min-width: 0;
        overflow: hidden;
        
        .title{
          display: block;
          font-weight: bold;
          overflow: hidden;
          text-overflow: ellipsis;
          white-space: nowrap;
        }
        
        .descr{
          display: block;
          margin-top: 0.25rem;
          overflow: hidden;
          text-overflow: ellipsis;
          white-space: nowrap;
        }
      }
    }
  }
  
  .body{
    flex: 1;
    text-align: center;
  }
}
              
            
!

JS

              
                
              
            
!
999px

Console