I have div
of id = 'retangulo'
with position:absolute;
. When the page loads, this vertical rectangle only appears in half. I want when the person rolls the site at a time when the whole rectangle appears, it stays with position:fixed;
always following the movement of the screen.
header{
width:100%;
height:150px;
background-color:#423142;
}
div#retangulo{
width:50px;
height:400px;
background-color: green;
position:absolute;
top:220px;
left:100px;
}
footer{
height:200px;
width:100%;
background-color:red;
position:absolute;
top: 1500px;
}
<header></header>
<div id="retangulo">
{texto exemplo....}
</div>
<footer></footer>
Exemplifying with fiddle: link
Following the example: As you can see, in opening the example, we see that we are not completely seeing the div of the rectangle, but there is a moment that scrolling down can see the whole rectangle. At this point, I would like the rectangle to have position:fixed;
following the screen.