My page has a <body>
element with a height of 800px, however the content exceeds this height.
I would like the body to display content up to 800px and then hide the rest, but using overflow:hidden
hides all content beyond the viewport height of 678px
. I want the scroll bar to appear once the content reaches 800px.
Below is my code:
HTML
<div class="block">
</div>
<div class="block">
</div>
<div class="block">
</div>
<div class="block">
</div>
<div class="block">
</div>
<div class="block">
</div>
<div class="block">
</div>
<div class="block">
</div>
<div class="block">
</div>
<div class="block">
</div>
<div class="block">
</div>
<div class="block">
</div>
<div class="block">
</div>
<div class="block">
</div>
CSS
body{
height: 800px;
overflow: hidden;
}
.block{
background: #000;
height: 100px;
width: 100%;
margin-bottom: 10px;
}
Here is the fiddle demonstrating the issue: https://jsfiddle.net/0b6g6886/