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

              
                <article>
  <h3 class="single-ellipsis">這是一個很長的標題超過一行就會隱藏,還包含 English text 可以再更多更多字,請再試試看,超過一行就會隱藏接下來的文字</h3>
  <p class="multiline-ellipsis">"As Chiang becomes more refined through life, the glistens of time, like fine nectar after a long period of brewing, also flow between life and art in a freer way--whether the light within his heart or natural daylight, he can always unfetteredly convert it into fleeting inspiration at this stage</p>
</article>
              
            
!

CSS

              
                body {
  margin: 0;
  padding: 0;
  font: 100%/1.7 sans-serif;
  background: #eee;
}
:last-child {
  margin-bottom: 0;
}
article {
  margin: 40px auto;
  padding: 30px;
  max-width: 300px;
  background: #fff;
  box-shadow: 0 5px 15px rgba(0,0,0,.25);
}
h3 {
  margin: 0 0 .5em 0;
  line-height: 1.4;
}
.single-ellipsis {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.multiline-ellipsis { 
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 5;
  overflow: hidden;
  word-break: break-word;        /* Breaks the word properly */
  white-space: normal;           /* Allows the text to wrap normally */

  /* line-clamp: 5; */
  
  /*
  display: flex;
  flex-direction: column;
  line-clamp: 5;
  overflow: hidden;
  */
}
              
            
!

JS

              
                
              
            
!
999px

Console