html - Why does the images not come one after another? -



html - Why does the images not come one after another? -

i want have divs class image-1 inline within div having class of image-wrapper. have tried lot divs class image-1 not getting inline. may know doing mistake??

<style> *{ margin:0; padding:0; } .wrapper{ width:100%; height:400px; background-color:#666; padding:5px; box-sizing:border-box; overflow-x:hidden; } .image-wrapper{ width:300%; height:390px; background-color:#000; } .image-1{ width:100%; height:100%; background-color:#03f; float:left; display:inline-block; } </style> </head> <body> <div class="wrapper"> <div class="image-wrapper"> <div class="image-1"> </div> <div class="image-1"> </div> <div class="image-1"> </div> </div> </div> </body>

1) remove float:left image-1 elements

2) set white-space:nowrap; on image-wrapper

fiddle

class="snippet-code-css lang-css prettyprint-override">* { margin: 0; padding: 0; } .wrapper { height: 400px; background-color: #666; padding: 5px; box-sizing: border-box; } .image-wrapper { height: 390px; background-color: #000; white-space: nowrap; overflow-y: hidden; overflow-x: auto; } .image-1 { width: 100%; height: 100%; background-color: #03f; display: inline-block; } .image-1 + .image-1 { background-color: wheat; } .image-1 + .image-1 + .image-1 { background-color: tomato; } class="snippet-code-html lang-html prettyprint-override"><div class="wrapper"> <div class="image-wrapper"> <div class="image-1"> </div> <div class="image-1"> </div> <div class="image-1"> </div> </div> </div>

html css

Comments

Popular posts from this blog

php - How to pass multiple values from url -

xslt - DocBook 5 to PDF transform failing with error: "fo:flow" is missing child elements. Required content model: marker* -

database - php search bar when I press submit with nothing in the search bar it shows all the data -