Reputation: 215
How do I make it so that when I scroll down my sidebar stays in the same place
I have looked around but still can't find anything.
This is my code
<div class="example">
//stuff goes here
</div>
<style>
.example {
float: left;
background: blue;
width: 100px;
height: 100px;
}
</style>
Thanks in advance
Upvotes: 0
Views: 321
Reputation: 2420
.sidebar{
position:fixed;
right:0;
top:0;
}
I presume you want it to follow while scrolling?
Upvotes: 5