horizontal scroll of inline-block element

What about a bit more state-of-the-art solution using transform?

HTML

<div class="horizontal-scroll-wrapper">
  <div>item 1</div>
  <div>item 2</div>
  <div>item 3</div>
  <div>item 4</div>
  <div>item 5</div>
  <div>item 6</div>
  <div>item 7</div>
  <div>item 8</div>
  <div>item 9</div>
  <div>item 10</div>
</div>

CSS

div {
  box-sizing: border-box;
}

.horizontal-scroll-wrapper {
  background: #abc;
  display: block;
  max-height: 500px;
  overflow-y: auto;
  overflow-x: hidden;
  padding-top: 60px;
  position: absolute;
  transform: rotate(-90deg) translateY(-80px);
  transform-origin: right top;
}

.horizontal-scroll-wrapper > div {
  background: #cab;
  height: 60px;
  margin: 10px;
  padding: 5px;
  transform: rotate(90deg);
  transform-origin: right top;
  width: 60px;
}

CodeSandbox, inspired by https://css-tricks.com/pure-css-horizontal-scrolling/


Hide the y overflow and use nowrap

.dx {
    height: 100px;
    overflow-y: hidden;
    white-space: nowrap;
    width: 100%;
}

FIDDLE


Use white-space: nowrap; on dx class.

Fiddle

.dx{
    width:100%;
    height:100px;
    overflow:scroll;
    white-space: nowrap;
}

Tags:

Html

Css