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.

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

            
              <h1 class="py-3">Test of a responsive image placeholder for HTML wireframing </h1>
<p>
  <a href="https://codepen.io/agibdk/pen/zJxzWQ">Image placeholder</a> in HTML/CSS without images or JavaScript. Created with ideas from <a href="https://codepen.io/juicypixels/pen/gPravL">Juicy Pixels</a>.
</p>
<p>
  Accompanying <a href="http://agib.dk/posts/2018/responsive-image-placeholder-for-html-wireframes.html">blog post</a>.</p>

<hr>

<div class="container-fluid">
  <div class="agibdk-image-placeholder h-14r" data-text="Services illustration header image"></div>
  <h2 class="text-center font-weight-bold py-5">Services</h2>
  <div class="row">
    <div class="col-md mb-5">
      <div class="agibdk-image-placeholder h-10r" data-text="Illustration of responsive design"></div>
       <h4 class="py-3">Responsive design</h4>
      <p>A very brief description of what it is how it benefits the client's business.</p>
      <a href="#" class="btn btn-block btn-primary">Responsive design &rarr;</a>
    </div>
    <div class="col-md mb-5">
      <div class="agibdk-image-placeholder h-10r" data-text="Illustration of expert reviews"></div>
       <h4 class="py-3">Expert reviews</h4>
      <p>A very brief description of what it is how it benefits the client's business.</p>
      <a href="#" class="btn btn-block btn-primary">Expert reviews &rarr;</a>
    </div>
    <div class="col-md mb-5">
      <div class="agibdk-image-placeholder h-10r" data-text="Illustration of prototyping"></div>
      <h4 class="py-3">Prototyping</h4>
      <p>A very brief description of what it is how it benefits the client's business.</p>
      <a href="#" class="btn btn-block btn-primary">Prototyping &rarr;</a>
    </div>
  </div>
</div>

<hr>
<div class="container-fluid">
  <h2 class="text-center font-weight-bold py-5">Cases</h2>
  <div class="row">
    <div class="col-md-7 mb-5">
      <div class="agibdk-image-placeholder h-14r" data-text="Illustration of case"></div>
       <h4 class="py-3">Case heading</h4>
      <p>Here goes an interesting teaser for the case, prompting users to learn more.</p>
      <a href="#" class="btn btn-outline-primary">More &rarr;</a>
    </div>
    <div class="col-md mb-5">
      <div class="agibdk-image-placeholder h-14r" data-text="Illustration of case"></div>
       <h4 class="py-3">Case heading</h4>
      <p>Here goes an interesting teaser for the case, prompting users to learn more.</p>
      <a href="#" class="btn btn-outline-primary">More &rarr;</a>
    </div>
  </div>
  <div class="row">
    <div class="col-md-5 mb-5">
      <div class="agibdk-image-placeholder h-14r" data-text="Illustration of case"></div>
       <h4 class="py-3">Case heading</h4>
      <p>Here goes an interesting teaser for the case, prompting users to learn more.</p>
      <a href="#" class="btn btn-outline-primary">More &rarr;</a>
    </div>
    <div class="col-md mb-5">
      <div class="agibdk-image-placeholder h-14r" data-text="Illustration of case"></div>
       <h4 class="py-3">Case heading</h4>
      <p>Here goes an interesting teaser for the case, prompting users to learn more.</p>
      <a href="#" class="btn btn-outline-primary">More &rarr;</a>
    </div>
  </div>
</div>
<hr>

 
            
          
!
            
              @border-color: #aaa;
@placeholder-text-padding: .25rem;
@placeholder-text-bg: white;
@bg-pos-offset: -3px;

body {
  padding: 1rem;
  font-family: sans-serif;
}

.h-10r {
  height: 10rem;
}
.h-14r {
  height: 14rem;
}


.container {
    width: 70%;
}


.agibdk-image-placeholder {
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  text-align: center;
  outline: 1px solid @border-color;
  background: linear-gradient(to top right, transparent 50%, @border-color, transparent 51%);
  background-color: #ddd;
  background-position-x: @bg-pos-offset;
  &::before {
    display: inline-block;
    content: attr(data-text);
    background-color: @placeholder-text-bg;
    padding: @placeholder-text-padding;
    z-index: 10;
  }
  &::after {
    content: "";
    display: block;
    position: absolute;
    top: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom right, transparent 50%, @border-color, transparent 51%);
    background-position-x: @bg-pos-offset;
  }
}
            
          
!
999px
🕑 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 ..................

Console