I\'m trying to get a div with a button next to a parent div. Like this:
____________
|relative |
| |
| |
| |_______
| |
you're looking for position: absolute, not fixed -- if your parent has the class parent and the button has the class button, what you need is similar to (assuming button has a fixed width of 100px for this):
.parent { position: relative; }
.button { position: absolute; top: 45%; right: -100px; }
here's an example fiddle (added some width/heights to demonstrate, these should come from your content instead) http://jsfiddle.net/WpnP4/
Edit: just realized the question is not 100% clear -- I assumed you wanted the button to be next to a specific element and scroll with the screen. Use position:fixed if you want the button element to stay fixed in the screen.