octocatstartv

Pen Settings

CSS Base

Vendor Prefixing

Add External CSS

These stylesheets will be added in this order and before the code you write in the CSS editor. You can also add another Pen here, and it will pull the CSS from it. Try typing "font" or "ribbon" below.

Quick-add: + add another resource

Add External JavaScript

These scripts will run in this order and before the code in the JavaScript editor. You can also link to another Pen here, and it will run the JavaScript from it. Also try typing the name of any popular library.

Quick-add: + add another resource

Code Indentation

     

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.

            
              
<h1>DEMONSTRATING THE DIFFERENCE BETWEEN DISPLAY NONE AND VISIBILITY NONE</H1>

<div class="page">
  
  <div class="wrapper">
    
    <div class="box">
      <p>This box is a specimen for comparison purposes.</p>
    </div>
    <div class="box">
      <p>This box is a second specimen for comparison purposes.</p>
    </div>
    <div class="box">
      <p>This box is a third specimen for comparison purposes.</p>
    </div> 
  </div>
  
    <div class="wrapper">
    
    <div class="box">
      <p>This box is a specimen for comparison purposes.</p>
    </div>
    <div class="box display">
      <p>This box is a second specimen for comparison purposes.</p>
    </div>
    <div class="box">
      <p>This is the third box but the second box is now missing.</p>
      <p>(via DISPLAY NONE)</p>
      <p>See how the space has collapsed?</p>
    </div> 
  </div>
 
      <div class="wrapper">
    
    <div class="box">
      <p>This box is a specimen for comparison purposes.</p>
    </div>
    <div class="box visible">
      <p>This box is a second specimen for comparison purposes.</p>
    </div>
    <div class="box">
      <p>This is the third box but the second box is now missing.</p>
      <p>(via VISIBILITY: NONE)</p>
      <p>See how the space is still there?</p>
    </div> 
  </div>
  
</div>


            
          
!
            
              * {
  box-sizing: border-box;
  margin:0;
  padding:0;
}

h1, p {
  text-align:center;
  padding: 0 5px;
}

.page {
  max-width:75%;
  margin:0 auto;
}

.wrapper {
  width:240px;
  float:left;
  margin:10px;
  background:lightblue;
}

.box {
  width:240px;
  background:lightgrey;
  border:1px solid grey;
  text-align:center;
}

.display {
  display:none;
}

.visible {
  visibility:hidden;
}
  
            
          
!
999px
Close

Asset uploading is a PRO feature.

As a PRO member, you can drag-and-drop upload files here to use as resources. Images, Libraries, JSON data... anything you want. You can even edit them anytime, like any other code on CodePen.

Go PRO

Loading ..................

Console