Pen Settings



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


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


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.


                <div style="width:25%;height:50px;">
        <div id="textInfos" style="
  overflow : hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
            脫離文件流:就不佔據空間了? 是的,一個元素脫離文件流後,其他的元素在定位時候回當做沒看見他,兩者位置

            重疊都是可以的。 2、脫離文件流不是從dom樹中脫離,用瀏覽器的審查元素可以看到脫離文件流的元素,依然會

            出現在dom樹裡 3、實質: 脫離文件流,也就是將元素從普通的佈局排版中拿走,其他盒子在定位的時候,會


            但其他盒子內的文字依然會為這個元素讓出位置,環繞在周圍。而對於使用absolute positioning脫離文件流的

  <a href="#" id="showText" style="position: fixed;">顯示更多</a>
  <hr />
  <div class="aa"></div>



            width: 400%;
            height: 100px;
            background: #000;


                 var isShow = false
        document.getElementById('showText').onclick = function() {
            if (isShow) {
                isShow = false
                this.value = "顯示更多"
                document.getElementById('textInfos').style.display = "-webkit-box"
            } else {
                isShow = true
                this.value = "隱藏"
                document.getElementById('textInfos').style.display = ""