thank you for the posting the link.
I checked all these pages.
I tried all evening, but nothing worked for my GP theme.
My intention is to use a plugin that creates content tables.
Table of Contents Plus https://wordpress.org/plugins/table-of-contents-plus/
This plugin creates a <span> for every heading h2, h3, h4 … as you wish
<h2><span id="created-from-heading">Created From Heading</span></h2>
and a content table entry like
<a href="#created-from-heading">Created From Heading</a>
No CSS-trick worked.
Until I found out, there is a checkbox in the backend “Enable smooth scroll effect”
Only when this is checked, you find in the advanced option:
“Smooth scroll top offset“