Reputation: 121
Here is the rough structure of the web-site:
<div class="wrapper">
<div class="content">
<div class="report">
</div>
</div>
</div>
Right now I do have next CSS:
.wrapper {
width: 75%;
margin: 0 auto;
}
So the question is, how can I prevent div with report class from overflowing div with wrapper class? In case of overflowing I want to add scroll to the div with report class.
Right now the "report" div just dynamicly extends width of the wrapper.
Thanks in advance!
Upvotes: 1
Views: 42
Reputation: 21100
Use overflow: auto;
to add a scrollbar only when and where scrolling is necessary. If the viewport is big enough, no scrollbars will appear. If the viewport is not wide enough but is tall enough, it will create a scrollbar only on the y-axis.
See this Mozilla Developer Network page on overflow
for more info.
Upvotes: 1