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. You can use the CSS from another Pen by using it's URL and the proper URL extention.

+ 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

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

              
                <!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
    <style>
        .grid>.column:not([class*="row"]) {
            border: 1px solid red;
        }

        .row>.column {
            border: 1px solid red;
        }
    </style>
</head>
<body>
    <h3>自动换行</h3>
    <p>column auto flow to next row</p>
    <div class="ui grid">
        <div class="four wide column">
            content
        </div>
        <div class="four wide column">
            content
        </div>
        <div class="four wide column">
            content
        </div>
        <div class="four wide column">
            content
        </div>

        <div class="four wide column">
            content
        </div>
        <div class="four wide column">
            content
        </div>
        <div class="four wide column">
            content
        </div>
        <div class="four wide column">
            content
        </div>
    </div>
    <h3>手动换行</h3>
    <p>add row force column flow to next row</p>
    <div class="ui three column grid">
        <div class="column">
            
        </div>
        <div class="row">
            <div class="column">
                content
            </div>
            <div class="column">
                content
            </div>
            <div class="column">
                content
            </div>
        </div>
    </div>
    
    <h3>指定 grid 的 column count</h3>
    <p>specify column count force column to flow to next row</p>
    <div class="ui three column grid">
        <div class="column"></div>
        <div class="column"></div>
        <div class="column"></div>
        <div class="column"></div>
        <div class="column"></div>
        <div class="column"></div>
        <div class="row">
            <div class="column">content</div>
            <div class="column">content</div>
            <div class="column">content</div>
            <!-- 称满一行 -->
        </div>
    </div>
    
    <h3>row 内的 column 默认没有高度</h3>
    <p>column in row have no height</p>
    <div class="ui three column grid">
        <div class="row">
            <div class="column">
            </div>
            <div class="column">
            </div>
            <div class="column">
            </div>
        </div>
    </div>
    
    <h3>指定 column 的宽度</h3>
    <p>specify column width</p>
    <div class="ui grid">
        <div class="four wide column"></div>
        <div class="column"></div>
        <div class="column"></div>
    </div>
    
    <h3>特定 grid 必须要有 row</h3>
    <p>format grid must specify row</p>
    <div class="ui celled grid">
        <div class="row" >
            <div class="column">content</div>
            <div class="column">content</div>
            <div class="column">content</div>
        </div>
    </div>
     
    <h3>居中 colum</h3>
    <p>center column</p>
    <div class="ui two column centered grid">
        <div class="column"></div>
        <div class="four column centered row">
          <div class="column">content</div>
          <div class="column">content</div>
        </div>
    </div>
  
    <h3>可以在任意级别 grid, row, column 指定文本的对齐方式</h3>
    <p>text align</p>
    <div class="ui grid">
        <div class="right aligned eight wide column">
          right aligned column
        </div>
        <div class="left aligned eight wide column">
          left aligned column
        </div>
        <div class="center aligned two column row">
          <div class="column">
            center aligned row
          </div>
          <div class="column">
            center aligned row
          </div>
        </div>
        <div class="sixteen wide right aligned column">
          right aligned column
        </div>
    </div>
    
    <h3>垂直居中</h3>
    <div class="ui middle aligned four column centered grid">
        <div class="row">
          <div class="column">
            <img class="ui wireframe image" src="https://avatars0.githubusercontent.com/u/1224344?v=3&s=460">
          </div>
          <div class="column">
            <img class="ui wireframe image" src="https://avatars0.githubusercontent.com/u/1224344?v=3&s=460">
            <img class="ui wireframe image" src="https://avatars0.githubusercontent.com/u/1224344?v=3&s=460">
          </div>
          <div class="column">
            <img class="ui wireframe image" src="https://avatars0.githubusercontent.com/u/1224344?v=3&s=460">
          </div>
        </div>
    </div>

    <h3>均分row,使column 等宽</h3>
    <div class="ui equal width grid">
        <div class="row">
          <div class="column">column</div>
          <div class="column">column</div>
          <div class="column">column</div>
          <div class="column">column</div>
        </div>
        <div class="row">
          <div class="column">column</div>
          <div class="column">column</div>
          <div class="column">column</div>
        </div>
    </div>
</body>
</html>
              
            
!

CSS

              
                
              
            
!

JS

              
                
              
            
!
999px

Console