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

JavaScript

Babel is required to process package imports. If you need a different preprocessor remove all packages first.

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

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

              
                
<!-- Just to demonstrate for the sake of dynamically generated content, you can have your cms inject the background-image into the section. If not dynamic, best practice is to designate them in the css and not the html -->
<section id="one" class="section fbg" style="background-image:url('https://placeimg.com/1900/1100/animals');">
	one
</section>
<section id="two" class="section">
	two
</section>
<section id="three" class="section fbg" style="background-image:url('https://placeimg.com/1800/1200/nature');">
	three
</section>
<section id="four" class="section">
	four
</section>
<section id="three" class="section fbg" style="background-image:url('https://placeimg.com/1900/1200/people');">
	five
</section>
              
            
!

CSS

              
                html {
  color:#eee;
  font-size: 70px;
  font-family:courier; 
}
/* fix the body to be full screen */
body {
  height:100%; /* top and bottom fixed to 0 would accomplish the samething, BUT since height percentage is dependent on the parent elements height, I'm using height:100% here to cascade down in order to allow the section and section:before to be designated as height:100%. */
	margin:0;
  position:absolute; // body just be absolute to expand height and width
  width:100%;
}
.fbg {
	background-attachment: fixed;
	background-position: 50% top;
	background-size: cover;
}
.section {  
	background: cover;
  height:100%;
  position:relative;  
  text-align:center;
  width:100%;
  &:before {
    content:'';
    display: inline-block;
    height:100%;  
    width:0px;
    vertical-align: middle;
  }
}
/* Use "background-color" and not just "background" else your other backgound attribute such as "size", "position", and "attachment" will be reset to default.*/
#one {background-color:RebeccaPurple;}
#two {background-color:Tomato;}
#three {background-color:SkyBlue;}
#four {background-color:MediumSeaGreen;}
#five {background-color:DarkRed;}

              
            
!

JS

              
                
              
            
!
999px

Console