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 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


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.


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 class="falls-1" id="falls_1">
  <div class="columns"></div>
  <div class="columns"></div>
  <div class="columns"></div>
  <div class="columns"></div>


                .falls-1  {
  letter-spacing: -.35em;
/* 设置4列,每列占25%宽度 */
.falls-1 .columns {
  letter-spacing: normal;
  width: 25%;
  display: inline-block;
  vertical-align: top;
.falls-1 .columns div{
  background-color: orange;
  margin: 0 10px 10px;
  padding: 10px;
  font-size: 40px;


                var listArray = [];
// 这里我们随机生成100个高度在50-400之间的数据
for (var i = 0; i < 100; i++) {
  listArray.push(parseInt(Math.random() * (400 - 50 + 1) + 50, 10));
var falls_1 = document.getElementById('falls_1');
var columns = falls_1.children;
// 循环数据数组
for(var x = 0; x<listArray.length; x++){
  var curColumns = columns[0];
  var item = document.createElement('div'); = listArray[x] + 'px';
  item.innerText = x;
  // 通过判断哪一列最低然后获取最低的列
  for(var y = 1; y<columns.length; y++){
      curColumns = columns[y];
  // 把元素添加的最低的列