css Audio - Active file-generic CSS - Active Generic - Active HTML - Active JS - Active SVG - Active Text - Active file-generic Video - Active header Love html icon-new-collection icon-person icon-team numbered-list123 pop-out spinner split-screen star tv

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

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

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

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

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.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

            
              <div class="container">
 <header class="custom-padding" style="--padding-both: 2">
   <h1>Smart classes with custom properties</h1>
      <p>Lorem, ipsum dolor sit amet consectetur adipisicing elit. Et eos exercitationem repudiandae unde nemo tempora facilis voluptatum esse iste omnis? Repellat dolorum minima sapiente, at aliquid dolores vitae voluptatum iure?</p>
  </header>
  <hr>
 <div class="custom-padding">
     <p>Veritatis illo velit, fuga dolores repellat omnis perspiciatis libero accusamus? Veritatis libero voluptates, assumenda beatae rerum culpa minima voluptate, ut quia maxime perspiciatis, blanditiis iure velit suscipit totam deleniti praesentium?</p>

    <p>Ea voluptatibus dolores, facilis maiores odio ullam delectus magnam hic quam unde harum tempora architecto illo nam voluptatum fugit iusto debitis sit id sequi modi fugiat, sint blanditiis! Est, ratione.</p>
  </div>
  <hr>
  <!-- flexibilidad total -->
<div class="custom-padding" style="--padding-top:0.5; --padding-bottom: 1.5;">
  <p>Rem, odit fugit. Nisi quos nesciunt odit corporis ullam quae, perspiciatis distinctio et eaque? Maiores, amet officiis sint asperiores, accusamus iste facilis eaque unde deserunt sapiente aperiam quos. Nobis, nihil.</p>
  <p>Dolorum nam vero, enim quis culpa velit, optio quasi ipsam doloremque odio recusandae explicabo libero ullam beatae distinctio temporibus repudiandae officia, nulla non neque? Accusantium incidunt molestias explicabo inventore veritatis.</p>        </div>
<hr>
  <p class="custom-padding" style="--padding-bottom:0;">Corrupti, voluptas itaque. Sint voluptatum rem ullam iure eligendi itaque, ab ducimus veritatis at dolorem aspernatur exercitationem eos a. Obcaecati aliquid temporibus rerum voluptate tenetur suscipit vel incidunt reprehenderit omnis?</p>
  
  <div style="--custom-margin-top:3">
    <p><strong>Ahora sin utilizar clases</strong></p>
  </div>
  <p>Porro dolores omnis rem quos nesciunt nemo atque ipsa unde culpa soluta nisi accusantium esse labore architecto sunt, optio deserunt hic earum saepe commodi dicta. Rem consequatur dicta sed maiores.</p>
  <p>Perferendis quia atque architecto maiores veritatis neque odit nisi, fugit ducimus deserunt ex mollitia dignissimos veniam fuga numquam animi? Iure dignissimos culpa ipsam vero minus, impedit reprehenderit fugit numquam nihil?</p>
</div>
            
          
!
            
              :root {
  /* Unidad de espacidado */
  --space: calc(.5rem + 2vw);
  --color-lines: rgba(0,0,0, .4);
}

/* Centralizado y actualización dinámica */
@media(min-width: 1600px) {
  :root {
    --space: 2.5rem;
  }
}

/*
 valor por defecto 1 espacio arriba y abajo
 máxima flexibilidad
*/
.custom-padding {
    padding-top: calc( var(--padding-top, 
                       var(--padding-both, 1))
                       * var(--space)
                      );
  
    padding-bottom: calc( var(--padding-bottom, 
                          var(--padding-both, 1))
                       * var(--space)
                      );
}


/* 🔥 ahora sin clase */
[style*="--custom-margin-bottom"] {
  margin-bottom: calc( var(--custom-margin-bottom) * var(--space));
}

[style*="--custom-margin-top"] {
  margin-top: calc( var(--custom-margin-top) * var(--space));
}


/* ------------------------------------- */







/* Solo para presentación */
h1 {
  font-size: 3rem;
  line-height: 1.2;
  margin-bottom: var(--space);
}
p:not(:last-child) {
  margin:0 0 var(--space);
}

.custom-padding:nth-of-type(2) {
  max-width: 780px;
  margin-left: auto;
  
}
.container {
  width: 90%;
  margin:auto;
  max-width: 970px;
}

header {
  max-width: 620px;
}
hr {
  border:0;
  border-top: 1px dotted var(--color-lines);
  margin: 0 calc(-50vw - 50%);
}
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont,
    “Segoe UI”, “Roboto”, “Oxygen”, “Ubuntu”, “Cantarell”,
    “Fira Sans”, “Droid Sans”, “Helvetica Neue”,
    sans-serif;
  font-size: 17px;
  line-height: 1.6;
  padding-bottom: calc(var(--space) * 4);
}
  
* {
  box-sizing: border-box;
  margin:0;
}

            
          
!
999px
🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.
Loading ..................

Console