Pen Settings

HTML

CSS

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. You can use the CSS from another Pen by using it's URL and the proper URL extention.

+ add another resource

JavaScript

Babel includes JSX processing.

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

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

Behavior

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.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                <div class="wrapper wrapper-light">
  <div class="scrollable-container">
    <div class="scrollable-cards">

      <div class="card-h">
        <div class="card-thumbnail">
          <img src="https://res.cloudinary.com/hammv7x3f/image/upload/c_fill,g_face,h_320,w_320/v1522503864/ngpb7rercmaftyoanant.jpg">
          <div class="tag tag-primary card-tag">
            <svg width="13" height="13" viewBox="0 0 13 13" fill="none" xmlns="http://www.w3.org/2000/svg">
              <path d="M6.32595 11.2559L5.56198 10.556C2.84698 8.094 1.05398 6.47002 1.05398 4.47702C1.0501 4.0951 1.12245 3.71623 1.26681 3.36264C1.41118 3.00904 1.62467 2.68776 1.89474 2.41769C2.16481 2.14762 2.48603 1.93425 2.83963 1.78988C3.19322 1.64552 3.57209 1.57311 3.95401 1.57699C4.40501 1.58027 4.85002 1.68009 5.25918 1.86984C5.66834 2.05958 6.0321 2.33482 6.32595 2.67697C6.61981 2.33482 6.98357 2.05958 7.39273 1.86984C7.80189 1.68009 8.24696 1.58027 8.69796 1.57699C9.07984 1.57325 9.45863 1.64571 9.81216 1.79013C10.1657 1.93454 10.4869 2.14802 10.7569 2.41806C11.027 2.68809 11.2404 3.00922 11.3849 3.36276C11.5293 3.71629 11.6017 4.09514 11.598 4.47702C11.598 6.47002 9.80599 8.094 7.08999 10.561L6.32595 11.2559Z" fill="#1A1A1A"/>
            </svg>
            Praticien de la semaine
          </div>
          
          <div class="card-specialties">
            ART-THÉRAPIE
          </div>
        </div>
        <div class="card-body">
          <h3 class="card-title">
            Réflexologie de confort & Expression par le rythme
          </h3>
          <div class="card-name">
            Alice Larrabure
          </div>
        </div>
        <div class="card-foot">
          <div class="card-rating">
            <div class="stars">
              <svg width="10px" viewBox="0 0 20 20" fill="#FFD100">
                <polygon points="9.9, 1.1, 3.3, 21.78, 19.8, 8.58, 0, 8.58, 16.5, 21.78">
              </svg>
              <svg width="10px" viewBox="0 0 20 20" fill="#FFD100">
                <polygon points="9.9, 1.1, 3.3, 21.78, 19.8, 8.58, 0, 8.58, 16.5, 21.78">
              </svg>
              <svg width="10px" viewBox="0 0 20 20" fill="#FFD100">
                <polygon points="9.9, 1.1, 3.3, 21.78, 19.8, 8.58, 0, 8.58, 16.5, 21.78">
              </svg>
              <svg width="10px" viewBox="0 0 20 20" fill="#FFD100">
                <polygon points="9.9, 1.1, 3.3, 21.78, 19.8, 8.58, 0, 8.58, 16.5, 21.78">
              </svg>
              <svg width="10px" viewBox="0 0 20 20" fill="#FFD100">
                <polygon points="9.9, 1.1, 3.3, 21.78, 19.8, 8.58, 0, 8.58, 16.5, 21.78">
              </svg>
            </div>
            7 commentaires
          </div>
        </div>
      </div>

      <div class="card-h">
        <div class="card-thumbnail">
          <img src="https://res.cloudinary.com/hammv7x3f/image/upload/c_fill,g_face,h_320,w_320/v1522748419/lz9awyiyhu3art6p8xsg.jpg">
          
          <div class="card-specialties">
            Access Bars® <br>
            NATUROPATHIE <br>
            NUTRITION <br>
            PLANTES & HUILES ESSENTIELLES
          </div>
        </div>
        <div class="card-body">
          <h3 class="card-title">
            Réflexologie de confort
          </h3>
          <div class="card-name">
            Farah Benwahoud
          </div>
        </div>
        <div class="card-foot">
          <div class="card-rating">
            <div class="stars">
              <svg width="10px" viewBox="0 0 20 20" fill="#FFD100">
                <polygon points="9.9, 1.1, 3.3, 21.78, 19.8, 8.58, 0, 8.58, 16.5, 21.78">
              </svg>
              <svg width="10px" viewBox="0 0 20 20" fill="#FFD100">
                <polygon points="9.9, 1.1, 3.3, 21.78, 19.8, 8.58, 0, 8.58, 16.5, 21.78">
              </svg>
              <svg width="10px" viewBox="0 0 20 20" fill="#FFD100">
                <polygon points="9.9, 1.1, 3.3, 21.78, 19.8, 8.58, 0, 8.58, 16.5, 21.78">
              </svg>
              <svg width="10px" viewBox="0 0 20 20" fill="#FFD100">
                <polygon points="9.9, 1.1, 3.3, 21.78, 19.8, 8.58, 0, 8.58, 16.5, 21.78">
              </svg>
              <svg width="10px" viewBox="0 0 20 20" fill="#FFD100">
                <polygon points="9.9, 1.1, 3.3, 21.78, 19.8, 8.58, 0, 8.58, 16.5, 21.78">
              </svg>
            </div>
            20 commentaires
          </div>
        </div>
      </div>
                
      <div class="card-h">
        <div class="card-thumbnail">
          <img src="https://res.cloudinary.com/hammv7x3f/image/upload/c_fill,g_face,h_320,w_320/v1542202459/ilncu71pfjlq2ilei7gl.jpg">
          <div class="card-specialties">
            EMDR <br>
            PSYCHO-ÉNERGÉTIQUE <br>
            RESPIRATION HOLOTROPIQUE
          </div>
        </div>
        <div class="card-body">
          <h3 class="card-title">
            Fenêtre sur soi et créativité : Champ d'argile®, Soulcollage®
          </h3>
          <div class="card-name">
            Solange Lemoine
          </div>
        </div>
        <div class="card-foot">
          <div class="card-rating">
            <div class="stars">
              <svg width="10px" viewBox="0 0 20 20" fill="#FFD100">
                <polygon points="9.9, 1.1, 3.3, 21.78, 19.8, 8.58, 0, 8.58, 16.5, 21.78">
              </svg>
              <svg width="10px" viewBox="0 0 20 20" fill="#FFD100">
                <polygon points="9.9, 1.1, 3.3, 21.78, 19.8, 8.58, 0, 8.58, 16.5, 21.78">
              </svg>
              <svg width="10px" viewBox="0 0 20 20" fill="#FFD100">
                <polygon points="9.9, 1.1, 3.3, 21.78, 19.8, 8.58, 0, 8.58, 16.5, 21.78">
              </svg>
              <svg width="10px" viewBox="0 0 20 20" fill="#FFD100">
                <polygon points="9.9, 1.1, 3.3, 21.78, 19.8, 8.58, 0, 8.58, 16.5, 21.78">
              </svg>
              <svg width="10px" viewBox="0 0 20 20" fill="#FFD100">
                <polygon points="9.9, 1.1, 3.3, 21.78, 19.8, 8.58, 0, 8.58, 16.5, 21.78">
              </svg>
            </div>
            45 commentaires
          </div>
        </div>
      </div>

      <div class="card-h">
        <div class="card-thumbnail">
          <img src="https://res.cloudinary.com/hammv7x3f/image/upload/c_fill,g_face,h_320,w_320/v1542904330/uycx26c5rajzsynaapzf.jpg">
          
          <div class="card-specialties">
            YOGA <br>
            YOGA DE L'ÉNERGIE <br>
            RUNNING <br>
          </div>
        </div>
        <div class="card-body">
          <h3 class="card-title">
            Running Yoga
          </h3>
          <div class="card-name">
            Philippe Carralou
          </div>
        </div>
        <div class="card-foot">
          <div class="card-rating">
            <div class="stars">
              <svg width="10px" viewBox="0 0 20 20" fill="#FFD100">
                <polygon points="9.9, 1.1, 3.3, 21.78, 19.8, 8.58, 0, 8.58, 16.5, 21.78">
              </svg>
              <svg width="10px" viewBox="0 0 20 20" fill="#FFD100">
                <polygon points="9.9, 1.1, 3.3, 21.78, 19.8, 8.58, 0, 8.58, 16.5, 21.78">
              </svg>
              <svg width="10px" viewBox="0 0 20 20" fill="#FFD100">
                <polygon points="9.9, 1.1, 3.3, 21.78, 19.8, 8.58, 0, 8.58, 16.5, 21.78">
              </svg>
              <svg width="10px" viewBox="0 0 20 20" fill="#FFD100">
                <polygon points="9.9, 1.1, 3.3, 21.78, 19.8, 8.58, 0, 8.58, 16.5, 21.78">
              </svg>
              <svg width="10px" viewBox="0 0 20 20" fill="#FFD100">
                <polygon points="9.9, 1.1, 3.3, 21.78, 19.8, 8.58, 0, 8.58, 16.5, 21.78">
              </svg>
            </div>
            12 commentaires
          </div>
        </div>
      </div>

      <div class="card-h">
        <div class="card-thumbnail">
          <img src="https://res.cloudinary.com/hammv7x3f/image/upload/c_fill,g_face,h_320,w_320/v1522503864/ngpb7rercmaftyoanant.jpg">
          <div class="card-specialties">
            ART-THÉRAPIE
          </div>
        </div>
        <div class="card-body">
          <h3 class="card-title">
            Réflexologie de confort & Expression par le rythme
          </h3>
          <div class="card-name">
            Alice Larrabure
          </div>
        </div>
        <div class="card-foot">
          <div class="card-rating">
            <div class="stars">
              <svg width="10px" viewBox="0 0 20 20" fill="#FFD100">
                <polygon points="9.9, 1.1, 3.3, 21.78, 19.8, 8.58, 0, 8.58, 16.5, 21.78">
              </svg>
              <svg width="10px" viewBox="0 0 20 20" fill="#FFD100">
                <polygon points="9.9, 1.1, 3.3, 21.78, 19.8, 8.58, 0, 8.58, 16.5, 21.78">
              </svg>
              <svg width="10px" viewBox="0 0 20 20" fill="#FFD100">
                <polygon points="9.9, 1.1, 3.3, 21.78, 19.8, 8.58, 0, 8.58, 16.5, 21.78">
              </svg>
              <svg width="10px" viewBox="0 0 20 20" fill="#FFD100">
                <polygon points="9.9, 1.1, 3.3, 21.78, 19.8, 8.58, 0, 8.58, 16.5, 21.78">
              </svg>
              <svg width="10px" viewBox="0 0 20 20" fill="#FFD100">
                <polygon points="9.9, 1.1, 3.3, 21.78, 19.8, 8.58, 0, 8.58, 16.5, 21.78">
              </svg>
            </div>
            7 commentaires
          </div>
        </div>
      </div>

      <div class="card-h">
        <div class="card-thumbnail">
          <img src="https://res.cloudinary.com/hammv7x3f/image/upload/c_fill,g_face,h_320,w_320/v1522748419/lz9awyiyhu3art6p8xsg.jpg">
          
          <div class="card-specialties">
            Access Bars® <br>
            NATUROPATHIE <br>
            NUTRITION <br>
            PLANTES & HUILES ESSENTIELLES
          </div>
        </div>
        <div class="card-body">
          <h3 class="card-title">
            Réflexologie de confort
          </h3>
          <div class="card-name">
            Farah Benwahoud
          </div>
        </div>
        <div class="card-foot">
          <div class="card-rating">
            <div class="stars">
              <svg width="10px" viewBox="0 0 20 20" fill="#FFD100">
                <polygon points="9.9, 1.1, 3.3, 21.78, 19.8, 8.58, 0, 8.58, 16.5, 21.78">
              </svg>
              <svg width="10px" viewBox="0 0 20 20" fill="#FFD100">
                <polygon points="9.9, 1.1, 3.3, 21.78, 19.8, 8.58, 0, 8.58, 16.5, 21.78">
              </svg>
              <svg width="10px" viewBox="0 0 20 20" fill="#FFD100">
                <polygon points="9.9, 1.1, 3.3, 21.78, 19.8, 8.58, 0, 8.58, 16.5, 21.78">
              </svg>
              <svg width="10px" viewBox="0 0 20 20" fill="#FFD100">
                <polygon points="9.9, 1.1, 3.3, 21.78, 19.8, 8.58, 0, 8.58, 16.5, 21.78">
              </svg>
              <svg width="10px" viewBox="0 0 20 20" fill="#FFD100">
                <polygon points="9.9, 1.1, 3.3, 21.78, 19.8, 8.58, 0, 8.58, 16.5, 21.78">
              </svg>
            </div>
            20 commentaires
          </div>
        </div>
      </div>
                
      <div class="card-h">
        <div class="card-thumbnail">
          <img src="https://res.cloudinary.com/hammv7x3f/image/upload/c_fill,g_face,h_320,w_320/v1542202459/ilncu71pfjlq2ilei7gl.jpg">
          <div class="card-specialties">
            EMDR <br>
            PSYCHO-ÉNERGÉTIQUE <br>
            RESPIRATION HOLOTROPIQUE
          </div>
        </div>
        <div class="card-body">
          <h3 class="card-title">
            Fenêtre sur soi et créativité : Champ d'argile®, Soulcollage®
          </h3>
          <div class="card-name">
            Solange Lemoine
          </div>
        </div>
        <div class="card-foot">
          <div class="card-rating">
            <div class="stars">
              <svg width="10px" viewBox="0 0 20 20" fill="#FFD100">
                <polygon points="9.9, 1.1, 3.3, 21.78, 19.8, 8.58, 0, 8.58, 16.5, 21.78">
              </svg>
              <svg width="10px" viewBox="0 0 20 20" fill="#FFD100">
                <polygon points="9.9, 1.1, 3.3, 21.78, 19.8, 8.58, 0, 8.58, 16.5, 21.78">
              </svg>
              <svg width="10px" viewBox="0 0 20 20" fill="#FFD100">
                <polygon points="9.9, 1.1, 3.3, 21.78, 19.8, 8.58, 0, 8.58, 16.5, 21.78">
              </svg>
              <svg width="10px" viewBox="0 0 20 20" fill="#FFD100">
                <polygon points="9.9, 1.1, 3.3, 21.78, 19.8, 8.58, 0, 8.58, 16.5, 21.78">
              </svg>
              <svg width="10px" viewBox="0 0 20 20" fill="#FFD100">
                <polygon points="9.9, 1.1, 3.3, 21.78, 19.8, 8.58, 0, 8.58, 16.5, 21.78">
              </svg>
            </div>
            45 commentaires
          </div>
        </div>
      </div>

      <div class="card-h">
        <div class="card-thumbnail">
          <img src="https://res.cloudinary.com/hammv7x3f/image/upload/c_fill,g_face,h_320,w_320/v1542904330/uycx26c5rajzsynaapzf.jpg">
          
          <div class="card-specialties">
            YOGA <br>
            YOGA DE L'ÉNERGIE <br>
            RUNNING <br>
          </div>
        </div>
        <div class="card-body">
          <h3 class="card-title">
            Running Yoga
          </h3>
          <div class="card-name">
            Philippe Carralou
          </div>
        </div>
        <div class="card-foot">
          <div class="card-rating">
            <div class="stars">
              <svg width="10px" viewBox="0 0 20 20" fill="#FFD100">
                <polygon points="9.9, 1.1, 3.3, 21.78, 19.8, 8.58, 0, 8.58, 16.5, 21.78">
              </svg>
              <svg width="10px" viewBox="0 0 20 20" fill="#FFD100">
                <polygon points="9.9, 1.1, 3.3, 21.78, 19.8, 8.58, 0, 8.58, 16.5, 21.78">
              </svg>
              <svg width="10px" viewBox="0 0 20 20" fill="#FFD100">
                <polygon points="9.9, 1.1, 3.3, 21.78, 19.8, 8.58, 0, 8.58, 16.5, 21.78">
              </svg>
              <svg width="10px" viewBox="0 0 20 20" fill="#FFD100">
                <polygon points="9.9, 1.1, 3.3, 21.78, 19.8, 8.58, 0, 8.58, 16.5, 21.78">
              </svg>
              <svg width="10px" viewBox="0 0 20 20" fill="#FFD100">
                <polygon points="9.9, 1.1, 3.3, 21.78, 19.8, 8.58, 0, 8.58, 16.5, 21.78">
              </svg>
            </div>
            12 commentaires
          </div>
        </div>
      </div>

    </div>
  </div>
</div>
              
            
!

CSS

              
                // Bootstrap
$grid-breakpoints: (
  xs: 0,
  sm: 576px,
  md: 768px,
  lg: 992px,
  xl: 1200px
) !default;

// Config
$tablet: map-get($grid-breakpoints, "md");
$desktop: map-get($grid-breakpoints, "lg");
$lightest-gray: #F6F6F6;
$holom: #FFD100;

body {
  font-size: 14px;
}

// Tag
.tag {
  border-radius: 4px;
  text-transform: uppercase;
  font-size: 10px;
  font-weight: bold;
  padding: 3px;
}
.tag-primary {
  background-color: $holom;
}

// Wrapper
.wrapper {
  padding: 26px 0;
}
.wrapper-light {
  background: $lightest-gray;
}


// Card
.card-h {
  scroll-snap-align: center;
  background: white;
  width: 240px;
  height: 320px;
  display: flex;
  flex-direction: column;
  .card-thumbnail {
    height: 190px;
    position: relative;
    overflow: hidden;
    img {
      display: block;
      width: 100%;
      height: 190px;
      object-fit: cover;
    }
  }
  .card-tag {
    position: absolute;
    top: 10px;
    left: 10px;
  }
  .card-body {
    padding: 14px 20px 0;
    flex: 1;
  }
  .card-foot {
    padding: 0 20px 14px 20px;
  }
  .card-title {
    font-size: 14px;
    font-weight: bold;
    position: relative;
    overflow: hidden;
    white-space: normal;
    margin-bottom: 6px;
    max-height: 52px;
  }
  .card-name {
    max-height: 42px;
    line-height: 16px;
  }
  .card-rating {
    self-align: flex-end;
    align-items: center;
    display: flex;
    font-size: 12px;
    font-weight: bold;
    .stars {
      margin-top: -2px;
      margin-right: 10px;
    }
  }
  .card-specialties {
    text-transform: uppercase;
    position: absolute;
    font-size: 10px;
    bottom: 0;
    left: 0;
    right: 0;
    color: white;
    padding: 14px 20px 14px;
    background: linear-gradient(to top, rgba(0,0,0,0.6) 0%,rgba(0,0,0,0) 100%);
  }
}

// Scrollable Cards
$container-max-widths: (
  992px: 960px,
  1200px: 1140px
);

.scrollable-container {
  width: 100%;
  margin-right: auto;
  margin-left: auto;
  @each $breakpoint, $max-width in $container-max-widths {
    @media (min-width: $breakpoint) {
      max-width: $max-width;
    }
  }
}

.scrollable-cards {
  scroll-snap-type: x mandatory;
	display: flex;
	overflow-x: scroll;
  display: flex;
  padding:  5px;
  -webkit-overflow-scrolling: touch;
  .card-h {
    flex-shrink: 0;
    margin: 5px 5px;
    &:last-child {
      border-right: 10px solid $lightest-gray;
    }
  }
}

@media (min-width: $desktop) {
  .scrollable-cards {
    flex-wrap: wrap;
    justify-content: center;
    padding: 10px / 2 0;
    .card-h {
      flex: 0 0 calc(25% - 10px);
      &:last-child {
        border-right: 0;
      }
    }
  }
}

              
            
!

JS

              
                if (CSS.supports('scroll-snap-align: start')) {
  alert("native");
} else {
  alert("polyfill");
  scrollSnapPolyfill();
}

              
            
!
999px

Console