Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs 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 its URL and the proper URL extension.

+ 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

Auto Save

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 id="one">
  <div class="row">
    <div class="small-12 columns">
      <h2>Step 1</h2>
      <ol>
        <li>Add the external CSS file: //cdnjs.cloudflare.com/ajax/libs/foundation/5.1.1/css/foundation.min.css</li>
        <li>Create a section and call it "one"</li>
        <li>Create a grid with one row and one column, using a "small" class (<em>"Code for small screens first, and larger devices will inherit those styles. Customize for larger screens as necessary."</em>)</li>
      </ol>
    </div>
  </div>
</section>

<div data-magellan-expedition="fixed">
  <dl class="sub-nav">
    <dd data-magellan-arrival="two"><a href="#two">Section two</a></dd>
    <dd data-magellan-arrival="three"><a href="#three">Section three</a></dd>
    <dd data-magellan-arrival="four"><a href="#four">Section four</a></dd>
  </dl>
</div>

<section data-magellan-destination="two">
  <div class="row">
    <div class="small-12 columns">
      <h2 id="two">Step 2</h2>
      <ol>
        <li>Add a new section called "two"</li>
        <li>Create a grid with a single-column row and a 3-column row below it</li>
        <li>Centre the text in the 3-column row</li>
      </ol>
    </div>
  </div>
  <div class="row text-center">
    <div class="small-4 columns">
      <h3>Column One</h3>
    </div>
    <div class="small-4 columns">
      <h3>Column Two</h3>
    </div>
    <div class="small-4 columns">
      <h3>Column Three</h3>
    </div>
  </div>
</section>

<section class="three" data-magellan-destination="three">
  <div class="row">
    <div class="small-12 columns">
      <h2 id="three">Step 3</h2>
      <ol>
        <li>Add a new section called "three"</li>
        <li>Create a grid with another single-column row</li>
        <li>Add background colours to sections one and three</li>
      </ol>
    </div>
  </div>
</section>


<section class="long" data-magellan-destination="four">
  <div class="row">
    <div class="small-12 columns">
      <h2 id="four">Step 4</h2>
      <ol>
        <li>Add a new section called "four"</li>
        <li>Add a nice big height attribute to the new section</li>
        <li>Add CSS links to jQuery and foundation.js</li>
        <li>Initialise foundation.js</li>
        <li>Add a Magellan navbar above section two</li>
        <li>Add a data-magellan-destination and id attribute to each of the sections</li>
        <li>Add a some padding to the sections (otherwise the navigation does not quite work)</li>
      </ol>
      
      <p>The <em>data-magellan-arrival</em> and <em>data-magellan-destination</em> attributes ensure that the section is highlighted in the navigation at the appropropriate point in the page.<p>
      
      <p>To get them to line up properly, you want the <em>data-magellan-destination</em> attribute to be placed on a div higher up the page than the <em>id</em> attribute.</p>

      <h2>Step 5</h2>
      <ol>
        <li>Add a background image with "no-repeat center fixed" attributes to section one (and try variants of these attributes)</li>
        <li>Add a height attribute to section one and make the text bold and black</li>
        <li>Add screen-size-dependent height attributes</li>
        <li>Open page in "debug" mode and play with the window size</li>
      </ol>
      
      <h2>Step 6</h2>
      <ol>
        <li>Go to <a href="https://www.google.com/fonts">Google fonts</a> and choose a font you like.</li>
        <li>Add the font to the header of the page and add a <em>font-family</em> attribute for the font to the body in your CSS</li>
      </ol>

      <h2>Step 7</h2>
      <ol>
        <li>Go and take a look at the Foundation docs and add more elements to the page, to taste</li>        
      </ol>
    </div>
  </div>
</section>
              
            
!

CSS

              
                body {
  font-family: 'Ubuntu', sans-serif;
}

#one {
  font-weight: bold;
  color: #000;
  background: url(http://upload.wikimedia.org/wikipedia/commons/thumb/a/ad/2013_Rainbow_over_Washfold.jpg/1024px-2013_Rainbow_over_Washfold.jpg) no-repeat center fixed; 
  background-size: cover;
  height: 324px;
}
@media screen and (min-width: 768px) {
  #one { height: 432px; }
}
@media screen and (min-width: 1024px){
  #one { height: 576px; }
}

.three {
  background: #cccccc;
}

.long {
  height: 800px;
}

section {
  padding-top: 24px;
}

              
            
!

JS

              
                $(document).foundation(); 
              
            
!
999px

Console