Before you start
- The actual header selector.
- Knowledge of any scrolling containers above it.
- For direct mode: Node.js and a global stylesheet.
How to do it
- Check whether the current header is already fixed or sticky.
- Use the direct tool on the real header class. Review its inset and stacking rule.
- Scroll a long page and open any dropdown menu.
- Follow an in-page anchor and check that the target heading stays visible.
Before & after
.site-header { position: sticky; top: 0; z-index: 30; }The header stays visible while scrolling within its containing block, without jumping out of its original layout space.
Use with an AI coding tool
1 Describe your change
Use your own words. You do not need a file name. The prompt asks the AI to preserve unrelated work.
We remember this choice on this device. Choosing a tool does not connect it to this website.
2 Copy your prompt
Read the complete prompt below, then copy it.
3 Paste into your AI coding tool
Open your website or app project in your AI coding tool. Paste this into its AI chat box and send it. The tool needs access to your project files to make changes.
A website address alone does not give an AI permission or access to edit it. This prompt goes into an AI chat, not a regular terminal window.
4 Check the result
Check anchor offsets, mobile behavior, and that content is not covered.
Open your project preview and try the change. Review what changed before publishing. If it is wrong, use your tool’s undo or restore your saved project version.
If the result is not what you expected
Sticky appears not to work
An ancestor may create a different scroll container or restrict the available travel distance.
Anchor headings are hidden
Add an appropriate scroll-margin-top to the target headings or scroll-padding-top to the scroll container.
Undo the change
Remove the labelled sticky rule or restore the previous position, inset, and stacking settings.
References & testing
The examples above explain the expected behavior; they are not a claim that this prompt has been tested in every framework or AI model. The direct tool uses our shared local-edit engine; native Windows execution remains unverified.