SpinTheMic
Pro

Interview practice question

A sticky header hides content when jumping to anchors

Frontend Engineering · HTML and CSS · Intermediate

When users click links to page sections, the sticky header covers the section headings. How do you fix it?

What a strong answer covers

Your AI report card counts how many of these ideas you cover.

  • scroll-margin-top on target elements.
  • Or scroll-padding-top on scroll container.
  • Match header height (custom property).
  • Smooth scroll with reduced-motion respect.
  • Avoid JS hacks.
Practise this topic

Start without signing up. Sign in free to get an AI report card on your answer.

See all topics