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. You can use the CSS from another Pen by using it's URL and the proper URL extention.

+ add another resource


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


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.


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.


                <div class="header d-flex flex-column align-items-center">
  <h1 class="display-6 mt-3 mb-0">lightGallery</h1>
  <p class="lead mt-2 mb-4">
    lightGallery is a feature-rich, modular JavaScript gallery plugin for building beautiful image and video galleries for the web and the mobile
  <a class="btn mb-5 btn-outline-primary" href="" target="_blank">View on GitHub</a>
<div class="gallery-container d-flex align-items-center justify-content-center" id="gallery-container">
  <a data-lg-size="1400-1400" class="gallery-item" data-src="" data-sub-html="<h4>Photo by - <a href='' >Diego Guzmán </a></h4> <p> Location - <a href=''>Fushimi Ward, Kyoto, Japan</a></p>">
    <img class="img-fluid" src="" />
  <a data-lg-size="1443-1329" class="gallery-item" data-src="" data-sub-html="<h4>Photo by - <a href='' >Shah </a></h4><p> Location - <a href=''>Shinimamiya, Osaka, Japan</a></p>">
    <img class="img-fluid" src="" />
  <a data-lg-size="1400-1402" class="gallery-item" data-src="" data-sub-html="<h4>Photo by - <a href='' >Katherine Gu </a></h4><p> For all those years we were alone and helpless.</p>">
    <img class="img-fluid" src="" />


                body {
  padding: 40px;
  background-image: linear-gradient(#e8f0ff 0%, white 52.08%);
  color: #0e3481;
  min-height: 100vh;

.header .lead {
  max-width: 620px;

/** Below CSS is completely optional **/
.gallery-item {
  width: 200px;
  padding: 5px;



                import lightGallery from "";

import lgZoom from "";

import lgShare from "";

import lgHash from "";

lightGallery(document.getElementById("gallery-container"), {
  speed: 500,
  plugins: [lgZoom, lgShare, lgHash]