AtlasOfLivingAustralia / ala-wordpress-theme

WordPress theme for Atlas main site.
3 stars 3 forks source link

Anchor alignment with TOC #20

Closed aatteia closed 7 years ago

aatteia commented 7 years ago

When you are using the TOC on any anchor page, the alignment of the anchor falls behind the primary navigation.

In the screen shot below, I have selected the TOC 'How to download data', which is mostly obscured by the primary navigation: anchor-issue

Moving the anchor position to accommodate the primary navigation is needed.

PS. this is a known issue and I am just formalising it.

aatteia commented 7 years ago

So Stackoverflow suggests this as the fix:

"I solved it by adding a class to the anchor element with the topbar height as the padding-top value. <h1><a class="anchor" name="barlink">Bar</a></h1>

And then simply the css: .anchor { padding-top: 90px; }

matthewandrews commented 7 years ago

Hmm, that's not really a practical solution for us, as it would require manually adding the class to every heading element. And this particular approach adds 90px padding above every heading... not great.

I think we probably have to use Javascript for this.

matthewandrews commented 7 years ago

OK, found a CSS-only solution, and I've released it to the production site.