Dominicentek Gaming
Dominicentek Gaming

Reputation: 127

Make elements inside div ignore it's container size and make the container scrollable instead

I have a problem with my div elements.

<div style="width: 300px; height: 300px; overflow: scroll;">
<!-- Some stuff here -->
</div>

How can I make the elements inside it not go to next line and make the div horizontally scrollable instead?

Upvotes: 0

Views: 68

Answers (1)

Mehedi Hasan Siam
Mehedi Hasan Siam

Reputation: 1272

you can use overflow-x

<div style="width: 300px; height: 300px; overflow-x: scroll;">
  <img width="400" height = "300" src="https://via.placeholder.com/150">
</div>

Upvotes: 2

Related Questions