css Audio - Active file-generic CSS - Active Generic - Active HTML - Active JS - Active SVG - Active Text - Active file-generic Video - Active header Love html icon-new-collection icon-person icon-team numbered-list123 pop-out spinner split-screen star tv

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.

+ add another resource

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

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

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

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.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

              <div class="container">
<img class="laptop" 
  srcset="https://leniolabs.com/images/l-layoutit-mob.jpg 470w, https://leniolabs.com/images/l-layoutit.jpg" 
     sizes="(max-width: 470px) 100%, 100%"
  src="https://leniolabs.com/images/l-layoutit.jpg" alt="layoutit">
      <i class="laptop-base"></i>
<p>Collapse your browser to make the viewport 330px or so, (if you are on chrome reload the page). Start expanding the viewport to the maximum.<br> <a target="_blank" href="https://dribbble.com/shots/5421819-Responsive-images-with-srcset-and-CSS-illustrations?utm_source=Clipboard_Shot&utm_campaign=marianabelda&utm_content=Responsive%20images%20with%20srcset%20and%20CSS%20illustrations&utm_medium=Social_Share">GIF example in dribbble</a></p>

              * { box-sizing: border-box; }
body {
  background-color: #00435e;
  color: white;
  font-family: 'Lato', 'Lucida Grande', 'Lucida Sans Unicode', Tahoma, Sans-Serif;
img { width:100%; }
a { color: #ff9900; }
p {
  line-height: 1.4;
  margin: 0 auto;
  max-width: 58ch;
.container {
  margin: 2em auto;
  max-width: 40em;
  width: 80%;
.laptop {
    background: radial-gradient(100% 100% at 50% 50%, rgba(0, 0, 0, 0.4) 49%, transparent 50%) -26px 50%/20px 20px, linear-gradient(0deg, rgba(0, 0, 0, 0.4) 100%, transparent 0) calc(100% + 15px) 50%/6px 80px;
    background-repeat: no-repeat;
    border: 24px solid rgba(0, 0, 0, 0.3);
    border-left-width: 32px;
    border-radius: 15px;
    box-shadow: 0 0 0 4px rgba(0, 0, 0, 0.4);
    transition: background .5s ease-in-out;

@media screen and (min-width: 56.25em) {
  .laptop {
      background: radial-gradient(100% 100% at 50% 50%, rgba(0, 0, 0, 0.4) 49%, transparent 50%) 50% -14px/10px 10px;
      background-repeat: no-repeat;
      border-width: 15px 10px 30px;
  .laptop-base {
    background-color: #051d27;
    border-radius: 0 0 15px 15px;
    display: block;
    height: 24px;
    margin-left: -5%;
    margin-top: -20px;
    position: relative;
    width: 110%;
  .laptop-base:after {
      content: "";
      background-color: rgba(255, 255, 255, 0.2);
      border-radius: 0 0 5px 5px;
      display: block;
      height: 5px;
      margin: 0 auto;
      width: 50px;

@media screen and (max-width: 470px) {
  .laptop {
      background: radial-gradient(100% 100% at 50% 50%, rgba(0, 0, 0, 0.4) 49%, transparent 50%) 50% calc(100% + 36px)/30px 30px, linear-gradient(90deg, rgba(0, 0, 0, 0.4) 100%, transparent 0) 50% -20px/80px 6px;
      background-repeat: no-repeat;
      border-width: 45px 10px;
      min-height: 480px;
      max-height: 90vh;
      object-fit: cover;
      object-position: top left;
🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.
Loading ..................