I have 3 div elements in this format:
<div class='primary'> Some paragraphs. <div class="fixed"> Fixed div element.</div> <div class="scrolling"> Scrollable paragraph </div> </div primary> After some paragraphs in the primary <div>, there's a fixed <div> element. After the fixed <div>, there'll be scrollable paragraph. What I'd like to do is to fix the "primary" & "fixed" <div> elements to be fixed while the "scrolling" <div> will be scrollable inside the primary <div>.
When I scroll, only the content in the "scrolling" div element(the last div) should move while the rest(the first two) stays the same. How do I achieve this?
I've been playing around with the position: fixed; and position: relative; but I couldn't find what I wanted. Here's jsfiddle outline.