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

              
                <h1>Not working examples:</h1>
<div class="tile">
  <a class="action" href="#">
    <div class="subtitle">
      Some text that will be too long, and should be truncated using CSS for responsiveness.
    </div>
  </a>
  <a class="action action--r" href="#">
    <div class="sibling">&lt;sibling&gt;</div>
  </a>
</div>

<div class="tile" style="max-width: 100px">
  <a class="action" href="#">
    <div class="subtitle">
      Some text that will be too long, and should be truncated using CSS for responsiveness.
    </div>
  </a>
  <a class="action action--r" href="#">
    <div class="sibling">&lt;sibling&gt;</div>
  </a>
</div>


<h1>Fixed example:</h1>

<div>
<div class="tile">
  <a class="action" href="#" style="min-width:0">
    <div class="subtitle">
      Some text that I just -know- will be too long, and should be truncated using CSS for responsiveness.
    </div>
    <div class="subtitle">
      Some text that I just -know- will be too long, and should be truncated using CSS for responsiveness.
    </div>
  </a>
  <a class="action action--r" href="#">
    <div class="sibling">&lt;sibling&gt;</div>
  </a>
</div>
</div>
              
            
!

CSS

              
                .tile
  border: 1px solid black
  display: flex
  margin: 1em 0

.action
  border: 1px dashed black
  color: black
  flex-shrink: 1
  flex-grow: 1
  max-width: 100%
  padding: 1em
  text-decoration: none

.action--r
  flex-grow: 0
  flex-shrink: 0

.subtitle
  display: inline-block
  width: 100%
  
  white-space: nowrap
  overflow: hidden
  text-overflow: ellipsis
              
            
!

JS

              
                
              
            
!
999px

Console