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.

  <h1>Javascriptless Before/After Slider</h1>

    A simple html/css only before/after slider by <a target="_blank" href="https://twitter.com/Matt_R_Steele">@Matt_R_Steele</a>
  <p>Use the black box below to move the slider (refresh to see a new image)</p>

  <div class="container">
  <footer>All images provided by <a href="http://placeimg.com" target="_blank">placeimg.com</a></footer>
              $image: 'https://placeimg.com/640/400/any';
$img: $image + '?t=' + unique_id();

main {
  font-family: Helvetica, Arial, sans-serif;
  max-width: 800px;
  margin: 10px auto;
  a {
    color: #a00;
    &:hover {
      text-decoration: none;
  h1 {
    font-size: 1.75em;
    font-weight: lighter;
  h3 {
    font-size: 1.2em;
    margin-bottom: 1em;
    color: #333;
  h1, h3, p {
    text-align: center;
  p {
    font-weight: bold;

footer {
  text-align: center;
  font-size: 0.8em;
  color: #999;
  a {
    color: inherit;

.container {
  width: 640px;
  height: 400px;
  margin: 10px auto;
  border: solid 1px #ccc;
  background: url($img);
  div {
    filter: sepia(75%);
    height: 100%;
    width: 10%;
    max-width: 99%;
    resize: horizontal;
    // border-right: solid 1px #ccc;
    box-sizing: border-box;
    overflow: auto;
    position: relative;
    animation-delay: 1s;
    animation-duration: 2s;
    animation-name: preview;
    background: url($img);
    &::after {
      content: ' ';
      position: absolute;
      width: 1em;
      height: 1em;
      background: black;
      bottom: 0;
      right: 0;
      border: solid 1px white;
      border-right: 0;
      border-bottom: 0;
      cursor: col-resize;

@keyframes preview {
    0% {width: 10%;}
    50% {width: 90%;}
    100% {width: 10%;}

Loading ..................