Reputation: 91
What I have:
<div class="modal-body" >
<div style="background:red; width: 100px; height: 200px;">
A
<div style="background:green; width: 50px; height: 150px;">
B
</div>
</div>
</div>
Currently both divs "A" and "B" overflow outside of the modal window.
What I want is that
I cannot the change size of the div A because in real situation we have div "A" moving on canvas.
When I move it near the edge its overflow should be hidden. But overflow of div "B" should not.
Upvotes: 1
Views: 395
Reputation: 346
Div B is currently a children of div A. If div A is set to overflow: hidden, this hides everything that overflows from div A. So if div B overflows, it cannot be seen since it is inside div A and div A cannot be overflown.
Upvotes: 0
Reputation: 51211
This is not possible. The css overflow property always affects all child elements. So:
modal-body
will hide both child divs A and B.Upvotes: 2
Reputation: 479
This is not possible with the current HTML spec. Any element with overflow hidden prevents ANY of its children from appearing outside its bounds.
Upvotes: 0