I want my inner div, which is colored red, to not be visible outside of its parent div, which is blue. I used overflow: hidden;
, but that didn't seem to work. And I want to achieve this using CSS only, because JavaScript is giving me problems when I make pages in SharePoint.
Does anyone know how I can make the overflow hidden?
.container {
left: 0px;
width: 800px;
height: 1200px;
background: green;
}
.outer {
position: absolute;
left: 0px;
width: 600px;
height: 1000px;
background: blue;
overflow: hidden;
}
.inner {
position: fixed;
width: 100px;
height: 600px;
background: red;
margin-left: 0px;
}
<div class="container">
<div class="outer">
<div class="inner"></div>
</div>
</div>
<br/><br/><br/><br/><br/><br/>