Reputation: 6246
I have a long div inside a parent.
I think it needs to be absolutely positioned because I want to to scroll horizontally.
However I only want the section inside the parent div to be visible. I thought setting overflow: hidden on the parent would achieve this, however no such luck....
See this js fiddle for an example.
Does anyone know how to get this effect?
Thanks
Upvotes: 4
Views: 4328
Reputation: 13594
did you try using scroll value for the overflow property.
overflow:scroll;
also remove the position element
Upvotes: 0
Reputation: 538
You should set the parent (box1) to position:relative; Otherwise the box2 gets positioned relative to the body and gets outside the flow of box1.
Upvotes: 8