Skip to content

Properly fix scroll offset and resolve element overlap

Martyn Welch requested to merge wip/martyn/T7055-Fix-css into master

In 334c0498 a hack was added to force anchors to be visible (and not hidden behind the navigation bar) when following a link with a fragment. This was achieved by setting a large top padding and negative top margin.

This hack had the unintended consequence that when there is a title too close to the top of the page, the transparent padding of the title (which forms part of the title) covered the "Also available in PDF format" link, making it inaccessible.

Modern CSS has a scroll-margin-top attribute that can be used to correctly set a scroll margin (which is what is needed to properly fix the original issue). This seems to have broad adoption in modern browsers and this attribute failing to work isn't the end of the world anyway.

Tweak the CSS to use this attribute to replace the previous hack.

Signed-off-by: Martyn Welch martyn.welch@collabora.com

Merge request reports

Loading