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

              
                <section class="section-one section">
  <h1>Responsive Diagonal Sections</h1>
</section>
  
<section class="section-two section"></section>
  
<section class="section-three section">
  <p><div>Lorem ipsum dolor sit, amet consectetur adipisicing elit. Reiciendis asperiores, aperiam quibusdam ad cumque itaque enim! Repellendus libero cumque dignissimos sunt dicta atque, quam in aspernatur itaque iure ipsum aliquam!</div>
    <div>Lorem ipsum dolor sit amet consectetur adipisicing elit. Cupiditate nesciunt quae eligendi et earum voluptate possimus pariatur nemo ullam? Esse repellat quia aliquam suscipit delectus hic sapiente quos, eligendi maxime?</div>
  <div>Lorem ipsum dolor sit amet consectetur adipisicing elit. Harum aperiam illum culpa! Accusamus reprehenderit voluptas nam, aspernatur tenetur maiores eius quas incidunt culpa dicta doloremque inventore enim porro deserunt iste.</div>
  </p>
</section>
              
            
!

CSS

              
                body {
  font-family: Arial;
  margin: 0;
}

.section-one {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 220px;
  
  position: relative;
  
  &:after {
    position: absolute;
    bottom: -95px;
    left: 0;
    content: '';
    border-style: solid;
    border-width: 0 0 6rem 100vw;
    border-color: transparent #FFF transparent #FFF;
   }
  
  h1 {
    font-size: 3em; 
    margin-bottom: 0;
  }
  
  h3 {
    font-size: 1.4em;
    margin: 0;
  }
}  

.section-two {
  display: flex;
  align-items: center;
  color: white;
  height: 500px;
  background: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)), url('https://newevolutiondesigns.com/images/freebies/black-white-background-24.jpg');
  // background-attachment: fixed;
  background-size: cover;
  background-position: center; 
}

.section-three {
  height: 400px;
  padding: 70px;
  
  position: relative;
  
  &:before {
    position: absolute;
    top: -95px;
    left: 0;
    content: '';
    border-style: solid;
    border-width: 0 0 6rem 100vw;
    border-color: transparent #FFF #FFF transparent;
   } 
}
              
            
!

JS

              
                
              
            
!
999px

Console