The actual header is off the page when using the table of contents plugin to navigate a page section

Adam Duckworth September 22, 2020

I've applied the table of contents (TOC) macro to create a list of links at the header 3 level. I can click on these to navigate to different sections of the page. It's really annoying though because when I click on a link and go to a section the actual header itself scrolls off the top of the page. For example, if I click in the TOC to navigate to "Section 3", the page scrolls to that section but the actual text "Section 3" is just off the page so it's not visible to the user. The text within section 3 is visible, but not the header itself. This actually makes it a really poor experience because it's not clear if you were actually taken to the right section. Any fix for this?

Confluence Version: 7.4.3

1 answer

0 votes
David at David Simpson Apps
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
September 23, 2020

Do you have a fixed header at the top of your Confluence page?

It looks like you may need to add some scroll-padding or scroll-margin to your Global Stylesheet so that the anchor is not hidden underneath the fixed header 

An example is below:

body {
  scroll-padding: 100px;
  scroll-margin-top: 10em;
}

Set the offset for in-page anchors links. Live demo. More info about scroll-padding and scroll-margin.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events