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

              
                <div class="container">
  
  <h1>Responsive Image Gallery with Bootstrap 4 Flexbox</h1>
  <div class="d-flex flex-row flex-wrap">
 <picture>
  <source media="(min-width: 650px)" srcset="https://dummyimage.com/1200x600/ccc/000&text=A">
  <img src="https://dummyimage.com/600x300/ccc/000&text=A" alt="placeholder image"  class="img-fluid">
</picture>
    
     <picture>
  <source media="(min-width: 650px)" srcset="https://dummyimage.com/1200x600/999/000&text=B">
  <img src="https://dummyimage.com/600x300/999/000&text=B" alt="placeholder image"  class="img-fluid">
</picture>
    
 <picture>
  <source media="(min-width: 650px)" srcset="https://dummyimage.com/1200x600/ccc/000&text=C">
  <img src="https://dummyimage.com/600x300/ccc/000&text=C" alt="placeholder image"  class="img-fluid">
</picture>
    

    
     <picture class="w-lg-50">
  <source media="(min-width: 650px)" srcset="https://dummyimage.com/1200x600/999/000&text=D">
  <img src="https://dummyimage.com/600x300/999/000&text=D" alt="placeholder image"  class="img-fluid">
</picture>
    
     <picture class="w-lg-50">
  <source media="(min-width: 650px)" srcset="https://dummyimage.com/1200x600/ccc/000&text=E">
  <img src="https://dummyimage.com/600x300/999/000&text=E" alt="placeholder image"  class="img-fluid">
</picture>
    
     <picture>
  <source media="(min-width: 650px)" srcset="https://dummyimage.com/1200x600/999/000&text=F">
  <img src="https://dummyimage.com/600x300/999/000&text=F" alt="placeholder image"  class="img-fluid">
</picture>
    

    

    
    


  </div>
</div>
  



              
            
!

CSS

              
                
.d-flex {
  border:2px solid #000;
}
.d-flex picture {
  width:300px;
  flex: auto;
  cursor:pointer;
  border:2px solid #000;

}

@media (min-width: 992px) { 
  .w-lg-50 {width:50%!important;}
}










/*
####################################################
M E D I A  Q U E R I E S
####################################################
*/

/*
::::::::::::::::::::::::::::::::::::::::::::::::::::
Bootstrap 4 breakpoints
*/

/* 
Extra small devices (portrait phones, less than 544px) 
No media query since this is the default in Bootstrap because it is "mobile first"
*/


/* Small devices (landscape phones, 544px and up) */
@media (min-width: 544px) {  

}

/* Medium devices (tablets, 768px and up) 
The navbar toggle appears at this breakpoint */
@media (min-width: 768px) {  

}

/* Large devices (desktops, 992px and up) */
@media (min-width: 992px) { 

}

/* Extra large devices (large desktops, 1200px and up) */
@media (min-width: 1200px) {  
    
}



/*
::::::::::::::::::::::::::::::::::::::::::::::::::::
Custom media queries
*/

@media (max-width: 950px) { 

}

              
            
!

JS

              
                $(document).ready(function() {
 // executes when HTML-Document is loaded and DOM is ready
console.log("document is ready");
  
  
// document ready  
});


window.onload = function() {
 // executes when complete page is fully loaded, including all frames, objects and images
console.log("window is loaded");
  
  
// window load  
};



              
            
!
999px

Console