[ 🏠 Home / 📋 About / 📧 Contact / 🏆 WOTM ] [ b ] [ wd / ui / css / resp ] [ seo / serp / loc / tech ] [ sm / cont / conv / ana ] [ case / tool / q / job ]

/tool/ - Tools & Resources

Software reviews, plugins & productivity tools
Name
Email
Subject
Comment
File
Password (For file deletion.)

File: 1783611492524.jpg (83.09 KB, 1024x1024, img_1783611484076_k8tkrwlo.jpg)ImgOps Exif Google Yandex

877e9 No.1894

if u are using anchor links to jump to sections on a page, add
scroll-margin-top: 100px;
to ur target elements. this prevents the fixed header from covering up ur content when u navigate. it is much cleaner than adding useless empty padding to every section. **it also works perfectly with intersection observers

877e9 No.1895

File: 1783611675328.jpg (128.39 KB, 1024x1024, img_1783611659986_iuqr0uxy.jpg)ImgOps Exif Google Yandex

>>1894
the intersection observer part is a huge plus because it keeps your scrollspy logic from breaking. i used to rely on heavy padding-top offsets in my global stylesheet, but that always messed up the actual vertical rhythm of the layout. if you have a sticky header with variable height (like an accordion inside a nav), you can also use
scroll-padding-top
on the html element instead of individual targets. it's much easier to manage in a single line of CSS. just make sure your units match your header's height exactly or you'll still get that annoying overlap. do you handle the calculation for dynamic header heights via javascript or just hardcode the pixels?



[Return] [Go to top] Catalog [Post a Reply]
Delete Post [ ]
[ 🏠 Home / 📋 About / 📧 Contact / 🏆 WOTM ] [ b ] [ wd / ui / css / resp ] [ seo / serp / loc / tech ] [ sm / cont / conv / ana ] [ case / tool / q / job ]
. "http://www.w3.org/TR/html4/strict.dtd">