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>Flexbox Slider</h1>
<div class="wrap">
  <button onclick="prev()">&laquo;</button>
  <div class="sticky">♥</div>
  <div class="scroller">
    <ul class="items">
      <li class="item" style="background-image:url(https://farm6.staticflickr.com/5076/14164379250_71c3a5b32a_b.jpg);">HAMBURG</li>
      <li class="item" style="background-image:url(https://farm3.staticflickr.com/2937/14371160993_186df4a083_b.jpg);">URBAN LIGHTS</li>
      <li class="item" style="background-image:url(https://farm3.staticflickr.com/2914/14185397280_e51c40b1df_b.jpg);">SOUNDS</li>
  <button onclick="next()">&raquo;</button>
              @import url(https://fonts.googleapis.com/css?family=Noto+Sans:400,700);

  box-sizing: border-box;
  margin: 0;
  padding: 0;

  font: 18px 'Noto Sans', Arial, sans-serif;
  background: #333;

  padding: 20px;

  text-align: center;
  color: #f0f0f0;
  margin-bottom: 1em;

  width: 100px;
  text-align: center;
  color: #be2221;
  font-size: 16px;
  background: #f0f0f0;
  line-height: 250px;

  display: flex;
  align-items: stretch;
  width: 90%;
  margin: auto;

  width: 30px;
  border: none;
  background: transparent;
  color: #fff;
  font-size: 40px;
  text-align: center;
  outline: none;
  opacity: 0.5;
  transition: opacity 300ms ease-out;
    opacity: 1;

  flex: 1;
  overflow: hidden;

  list-style-type: none;
  white-space: nowrap;
  font-size: 0;
  line-height: 0;
  transition: transform 1s ease-in-out;

  padding: 30px 20px;
  display: inline-block;
  width: 100%;
  height: 250px;
  font-size: 25px;
  letter-spacing: -0.03em;
  line-height: 1;
  font-weight: bold;
  background-size: cover;
  background-position: 50% 50%;
  text-transform: uppercase;
  box-shadow: inset 0 0 10px rgba(0,0,0,0.5);
  &:nth-child(2) {
    color: #fff;
              var d = document;
var wrap = d.querySelector('.wrap');
var items = d.querySelector('.items');
var itemCount = d.querySelectorAll('.item').length;
var scroller = d.querySelector('.scroller');
var pos = 0;
var transform = Modernizr.prefixed('transform');

function setTransform() {
  items.style[transform] = 'translate3d(' + (-pos * items.offsetWidth) + 'px,0,0)';

function prev() {
  pos = Math.max(pos - 1, 0);

function next() {
  pos = Math.min(pos + 1, itemCount - 1);

window.addEventListener('resize', setTransform);
Loading ..................