How to implement scrolling of blocks in a container?

.container { font-size: 0; width: 75%; padding: 10px 0; margin: 0 auto; background-color: #ccc; white-space: nowrap; overflow: hidden; } .container-item { display: inline-block; width: 150px; height: 150px; margin-right: 5px; background-color: #47ada5; } 
 <div class="container"> <div class="container-item"></div> <div class="container-item"></div> <div class="container-item"></div> <div class="container-item"></div> <div class="container-item"></div> <div class="container-item"></div> </div> 

Jsfiddle

  • one
    helped answer ???? - L. Vadim
  • Those. In this case, is a wrapper for a container that hides a scroll? - A. Gr
  • one
    namely, pedding is added and scrolling remains invisible - L. Vadim
  • Thanks for the helpful advice! - A. Gr

1 answer 1

Change overflows to this: overflow-y: scroll;

 .container { font-size: 0; width: 75%; padding: 10px 0; margin: 0 auto; background-color: #ccc; white-space: nowrap; overflow-y: scroll; } 
  • Is there a way to scroll without scrolling? - A. Gr
  • one
    yes you can - create 2 diva, the first overflow: hidden; the second is overflow-y: scroll - one sits in the other - L. Vadim