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

              
                <!-- Author:  Christian Pecson -->
<!-- Date: July 2, 2016 -->

<!-- Container (Projects) -->
<section class="w3-content w3-container w3-padding-64">
  <h1 class="w3-center">My Photo Gallery</h1>
  <p class="w3-center"><em>Click on the images to make them bigger</em></p>

  <!-- Responsive Grid. Four columns on tablets, laptops and desktops. Will stack on mobile devices/small screens (100% width) -->
  <div class="w3-row-padding w3-center" appml-data="images">
    
    <div class="w3-col m4 w3-padding-16" appml-repeat="image">
      <img src="{{src}}" alt="alt" style="width:100%" onclick="onClick(this)" class="w3-hover-opacity">
    </div>
    
  </div>
</section>
<!-- End Container (Projects) -->

<!-- Modal for full size images on click-->
<div id="modal" class="w3-modal w3-black" onclick="this.style.display='none'">
  <span class="w3-closebtn w3-hover-red w3-text-white w3-xxxlarge w3-container w3-display-topright">×</span>
  <div class="w3-modal-content w3-animate-zoom w3-center w3-transparent w3-padding-64">
    <img id="img" style="max-width:100%">
  </div>
</div>

<footer class="w3-container w3-dark-grey w3-hover-black w3-padding-8 w3-center">
  Made with <span id="heart">❤</span> by Christian Pecson
</footer>
              
            
!

CSS

              
                #heart {
  color: #f77;
}

img:hover {
  cursor: pointer;
}
              
            
!

JS

              
                // Images and alt attribute
var images = {
  image: [
    {src: 'https://unsplash.it/400/301?random', alt: 'Project 1'}
    , {src: 'https://unsplash.it/400/302?random', alt: 'Project 2'}
    , {src: 'https://unsplash.it/400/303random', alt: 'Project 3'}
    , {src: 'https://unsplash.it/400/304?random', alt: 'Project 4'}
    , {src: 'https://unsplash.it/400/305?random', alt: 'Project 5'}
    , {src: 'https://unsplash.it/400/306?random', alt: 'Project 6'}
    , {src: 'https://unsplash.it/400/307?random', alt: 'Project 7'}
    , {src: 'https://unsplash.it/400/308?random', alt: 'Project 8'}
    , {src: 'https://unsplash.it/400/309?random', alt: 'Project 9'}
  ]
};

// Show Modal Image 
function onClick(element) {
  document.getElementById("img").src = element.src;
  document.getElementById("modal").style.display = "block";
}
              
            
!
999px

Console