cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-new-collectionicon-personicon-teamlog-outoctocatpop-outspinnerstartv

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

Quick-add: + add another resource

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.

Quick-add: + add another resource

Code Indentation

     

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.

            
              - var img = 'https://scriptura.github.io/Images/LotusTest'
- var alt = 'Lotus'

figure
  picture
    source(media='(min-width: 2000px)' srcset=img + '.jpg, ' + img + '.jpg 2x' sizes='100vw')
    source(media='(min-width: 1500px)' srcset=img + '2000.jpg, ' + img + '.jpg 2x' sizes='100vw')
    source(media='(min-width: 1000px)' srcset=img + '1500.jpg, ' + img + '2000.jpg 2x' sizes='100vw')
    source(media='(min-width: 800px)' srcset=img + '1000.jpg, ' + img + '2000.jpg 2x' sizes='100vw')
    source(media='(min-width: 600px)' srcset=img + '800.jpg, ' + img + '1500.jpg 2x' sizes='100vw')
    source(media='(min-width: 400px)' srcset=img + '600.jpg, ' + img + '1000.jpg 2x' sizes='100vw')
    source(media='(min-width: 300px)' srcset=img + '400.jpg, ' + img + '800.jpg 2x' sizes='100vw')
    source(srcset=img + '300.jpg' sizes='100vw')
    img(src=img + '.jpg' alt=alt)

//figure
//  picture
//    source(media='(min-width: 2000px)' srcset=img + '.jpg 2500w' sizes='100vw')
//    source(media='(min-width: 1500px)' srcset=img + '2000.jpg 2000w' sizes='100vw')
//    source(media='(min-width: 1000px)' srcset=img + '1500.jpg 1500w' sizes='100vw')
//    source(media='(min-width: 800px)' srcset=img + '1000.jpg 1000w' sizes='100vw')
//    source(media='(min-width: 600px)' srcset=img + '800.jpg 800w' sizes='100vw')
//    source(media='(min-width: 400px)' srcset=img + '600.jpg 600w' sizes='100vw')
//    source(media='(min-width: 300px)' srcset=img + '400.jpg 400w' sizes='100vw')
//    source(srcset=img + '300.jpg 300w' sizes='100vw')
//    img(src=img + '.jpg' alt=alt)
            
          
!
            
              body
  margin 1rem
  background-color #333

img // @note No styles for picture tag
  display block
  width 100%

figure
  //vertical-align middle
  max-width 40rem
  margin 1rem auto
  padding .5em
  background-color LightCoral // GreenYellow
            
          
!
            
              // @params 'w' indication sur la charge en px de l'image correspondante, '1x' valeur Retina...

// @link https://developers.google.com/web/fundamentals/design-and-ui/media/images/images-in-markup?hl=fr#amliorer-les-lments-img-avec-lattribut-srcset-pour-les-crans--haute-densit-de-pixels
// @link https://la-cascade.io/images-responsives-picture-et-srcset/
// @link http://www.hteumeuleu.fr/attribut-srcset-images-responsive/
// @link https://la-cascade.io/tag/images-responsives/
// @link https://css-tricks.com/video-screencasts/133-figuring-responsive-images/
// @link http://www.alsacreations.com/article/lire/1621-responsive-images-srcset.html

            
          
!
999px
Loading ..................

Console