I don’t know if this is exactly what you need, but only with CSS you can do it using position:sticky
or position:fixed
or If you want to see examples over the internet you can search for "css persistent div"
See the example with position:sticky
: (in this example the box starts at 120px from the top and at 50px from the top)
body {
height: 200vh;
background-image: url(http://placecage.com/500/500);
}
.teste {
background-color: red;
width: 100px;
height: 50px;
margin-top: 140px; /* altura que está do topo */
top: 50px; /* altura que vai parar antes do topo */
position: sticky;
}
<div class="teste"></div>
See the example with position:fixed
:
body {
height: 200vh;
background-image: url(http://placecage.com/500/500);
}
.box {
width: 100px;
height: 100px;
position: fixed;
z-index: 1000;
left: 1rem;
top: 1rem;
background-color: #f00;
}
<div class="box"></div>
Here’s Mozilla’s documentation on positioning elements with CSS https://developer.mozilla.org/en-US/docs/Web/CSS/position
Cool, I get it, now the question is: Do I have to run this div through "certain space" ... <div class="Row"> <div class="col-Md-8"> <p> fixed content here </p> <div class="col-Md-8"> <p> fixed content here </p> </div> <div class="col-Md-4"> <p>content of floating div here</p> </div> </div> I have this div col-Md-4(right side) to run between the space of the two Divs col-Md-8 (one on top of the other), I will have to make with JS the adjustment between them ?
– user33011
I got @hugocsl, it worked! I followed your css and it worked when it came to applying the class with the Divs inside Row. Thanks!
– user33011
@Eitaehnoiz Nice young that it worked!
– hugocsl