<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <style type="text/css"> div{ border: 1px solid black; } .ctn{ width: 300px; height: 300px; } .div1{ width: 200px; height: 200px; } .div2{ width: 200px; height: 200px; } .div3{ width: 200px; height: 200px; } </style> </head> <body> <div class="ctn"> <div class="div1">div1</div> <div class="div2">div2</div> <div class="div3">div3</div> </div> </body> </html>
.ctn {overflow-x: scroll; white-space: nowrap; width: 100%;}
.div1, .div2, .div3 {display: inline-block;}