Asyoucanseerightnow, theheaderdoesnotsticktothepagewhenwescrolldown, andthenormalthoughttofixthisistouse a fixedposition.
Sowewouldselectthatnavigation, whichwehave a classfourofMay.
Never.
Andthenwewouldjustsetthepositiontofixed, whichforcestheelementtostayin a sportingspotontheWebpage, andwewantittobeattheverytopofthescreensowe'llsaytopofzero.
Er, forexample, weadded a classherewegiveit, hadherlarge.
Wesaythat, youknow, I seethatwehavethispictureatthetopofourpageandwewantournavigationbartocomeunderneathofthatpagebutstillsticktothetopofourpagewhenwescrolldown.
Openthisupinlifesurveyhere, andwehave a listrighthereofdifferentelementsthatwehave a B, C, D andallthewaydown.
Andwhatwewantisaswescrollthroughourlist, wewantthis a headertostayatthetopofthepageuntilwegettothe B headeranduntilwegettotheseaheaderandsoon, allthewaydowntobeso.
Onceitpasses, thelastelementseebecomesthenewstickybusinessmomentinthatplaceand d andsoon.
Andthisisexactlywherestickypositionshines.
Thisisthereasonthatstickypositionwascreatedinordertocreatethesedynamicscrollingelementsinsideofyourpagethataren't justfixedat a certainspotonyourpageatalltimes.
So I hopeyouguyslearnsomethingfromthisquicklookintostickypositionwithCSSisreally a quiteuniquewaytopositionelementandincrediblyusefulwhendoingthingssuchasthislistvieworthisheaderviewdownherethatnormallyyouwouldneedtouseJavaScripttoachievebefore.
Soifyouguysenjoyedthevideo, pleasemakesuretoleave a lightbelowandletmeknowinthecomments.