1
I would like to know how to use CSS to put a DIV without position:fixed
about the half of another that this with overflow
.
I’d like it to stay that way:
The sample code I’m using is:
.div1 {
width: 100px;
height: 200px;
background: #ccc;
overflow-x: auto;
}
.div2 {
width: 50px;
height: 100px;
background: #000;
margin-left: 70px;
}
<div class="div1">
<div class="div2"></div>
</div>
Check out this answer: https://answall.com/a/269014/8063
– Sam
Anything you put inside a div with overflow will be restricted to the area of the div. In this case you should review the structure and position the div differently. You don’t need to use Fixed, but another way in which the div stays where you want in relation to another.
– Sam