Fixed Header Covering On-Page Links [SOLVED]

Published: 2022 June 07

software development web development user interface CSS technical troubleshooting technical troubleshooting - solved

Background

This project is built with Hugo and uses the Minimal Hugo theme.

This post is part of an ongoing effort to tailor the theme over time.

The Problem

When clicking on-page links the top of the content is covered by the site’s fixed header.

We want linked content to display just below the fixed header.

The Process

This is a common problem with a long history, so a web search quickly led to some helpful discussions of the issue:

The Solution

To implement the solution mentioned in those articles a simple addition was made to the css.html file in the project’s /static/css/ directory.

/*  General  */

html {
    scroll-padding-top: 70px; /* This allows on-page linked content to appear below fixed headers.  The value should be the height of the sticky header. */
}

With that change on-page linked content now appears below the fixed header as expected.

Copying Directory Structure With a Bash Script - With Help From ChatGPT AI

Published: 2024 January 22

Trouble Adding Accounts to Mozilla Thunderbird Email Client [SOLVED]

Published: 2023 September 02

Backing Up Git Config Values With a Bash Script

Published: 2023 August 25