Buttons with horizontal scrolling in tile layout
P粉823268006
2023-08-31 20:54:51
<p>I have a lot of buttons that scroll vertically in a tile layout, like this: </p>
<p>
<pre class="brush:html;toolbar:false;"><style>
.tile-button {
width:33.3%;
height:100px;
background-color: lightblue;
border: solid 1px gray;
white-space: normal;
maring: 0px;
}
</style>
<body style="margin: 0;">
<div style="width:100%;height:300px;background-color: coral;overflow-y: scroll;font-size:0px;">
<button class="tile-button">title</button>
<button class="tile-button">title</button>
<button class="tile-button">title</button>
<button class="tile-button">title</button>
<button class="tile-button">title</button>
<button class="tile-button">title</button>
<button class="tile-button">title</button>
<button class="tile-button">title</button>
<button class="tile-button">title</button>
<button class="tile-button">title</button>
<button class="tile-button">title</button>
<button class="tile-button">title</button>
<button class="tile-button">title</button>
<button class="tile-button">title</button>
<button class="tile-button">title</button>
<button class="tile-button">title</button>
<button class="tile-button">title</button>
<button class="tile-button">title</button>
<button class="tile-button">title</button>
<div>
</body></pre>
</p>
<p>Now I need to do the same thing, but only with horizontal scrolling.
Can anyone help me?
Thank you very much</p>
Just add this CSS code 'white-space:nowrap;' in the container DIV.
I found the solution: