Position sticky won't work until there are HTMLElement before it in the DOM especially <p> element with margin. If you, however, delete all the element before it in the DOM position sticky will work as expected.
<p class="o-text">
I do not find it easy to get sufficiently far away from this
Book, in the first sensations of having finished it, to refer
to it with the composure which this formal heading would
seem to require. My interest in it, is so recent and strong;
and my mind is so divided between pleasure and regret -
pleasure in the achievement of a long design, regret in the
separation from many companions - that I am in danger of
wearying the reader whom I love, with personal confidences,
and private emotions.
Besides which, all that I could say of the Story, to any
purpose, I have endeavoured to say in it.
It would concern the reader little, perhaps, to know, how
sorrowfully the pen is laid down at the close of a two-years’
imaginative task; or how an Author feels as if he were dismissing
some portion of himself into the shadowy world,
when a crowd of the creatures of his brain are going from
him for ever. Yet, I have nothing else to tell; unless, indeed,
I were to confess (which might be of less moment still) that
no one can ever believe this Narrative, in the reading, more
than I have believed it in the writing. Instead of looking back, therefore, I will look forward. I
cannot close this Volume more agreeably to myself, than
with a hopeful glance towards the time when I shall again
put forth my two green leaves once a month, and with a faithful remembrance of the genial sun and showers that
have fallen on these leaves of David Copperfield, and made
me happy. I REMARKED in the original Preface to this Book, that I
did not find it easy to get sufficiently far away from it, in
the first sensations of having finished it, to refer to it with
the composure which this formal heading would seem to
require. My interest in it was so recent and strong, and my
mind was so divided between pleasure and regret - pleasure
in the achievement of a long design, regret in the separation
from many companions - that I was in danger of wearying
the reader with personal...
/*
Position sticky won't work until there are HTMLElement before it in the DOM especially <p> element with margin. If you, however, delete all the element before it in the DOM position sticky will work as expected.
*/
Please Whitelist JSFiddle in your content blocker.
Help keep JSFiddle free for always by one of two ways:
Whitelist JSFiddle in your content blocker (two clicks)
Go PRO and get access to additional PRO features →
Join the 4+ million users, and keep the JSFiddle dream alive.
Ad-free
All ads in the editor and listing pages are turned completely off.
Use pre-released features
You get to try and use features (like the Palette Color Generator) months before everyone else.
Fiddle collections
Sort and categorize your Fiddles into multiple collections.
Private collections and fiddles
You can make as many Private Fiddles, and Private Collections as you wish!
Console
Debug your Fiddle with a minimal built-in JavaScript console.