html - Need Sticky Header/Footer but CMS won't let me code in the body tag -
i work in outdated content management system doesn't give me access body tag. there way create sticky footer , sticky header without using body tag?
if can put in head element, should it:
<script> var mystickyheader = document.createelement('div'); mystickyheader.style.background = 'white'; mystickyheader.style.position = 'fixed'; mystickyheader.style.top = 0; mystickyheader.style.left = 0; mystickyheader.style.right = 0; mystickyheader.style.zindex = 9999; // in case mystickyheader.innerhtml = 'my sticky header'; document.body.addeventlistener('load', function() { document.body.insertbefore(mystickyheader, document.body.firstchild); }, false); </script> switch mystickyheader.style.top mystickyheader.style.bottom footer.
Comments
Post a Comment