Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

prevent bootstrap affix moving div to left

I'm trying to prevent my right hand side div from moving to the left after I have used the affix property.

Any iudea how I do this please. You can see the issue here, just scroll down please:-

http://monkeygetnews.jonathanlyon.com/bs.html

Thanks

Jponathan

like image 782
Jonathan Lyon Avatar asked Jan 27 '13 00:01

Jonathan Lyon


1 Answers

When activated, scroll spy adds the class affix and position: fixed to the div it's spying on. This positioning takes the div out of normal flow and here the result is that it's floating to the left.

The solution is to add some css styling to float it where you want. In your page I think it would be something like:

.span3.affix{
position: fixed; /* to stop the div from scrolling */
top: 0;          /* to fix the div at the top its containing element */
right: 0;        /* to fix the div at the right of its containing element */
}

You might have to play with this a bit to get it where you would like. The important thing is that once you know the selector (in this case) is .span3.affix it's easy enough to work with.

Good luck!

like image 129
David Taiaroa Avatar answered Oct 18 '22 03:10

David Taiaroa