If you have a Google account, you can save this code to your Google Drive.
Google will ask you to confirm Google Drive access.
Save file as: Save file
Warning: The 10th of June 2021, we will discontinue the ability to save to Google Drive.You will still be able to access your stored code on Google Drive.
If you have saved a file to Google Drive, you can open it here:
Open file
Scroll this page to see how the navbar behaves with data-spy="affix" and data-spy="scrollspy".
The navbar is attached to the top of the page after you have scrolled a specified amount of pixels, and the links in the navbar are automatically updated based on scroll position.
Try to scroll this section and look at the navigation bar while scrolling! Try to scroll this section and look at the navigation bar while scrolling!
If you want to report an error, or if you want to make a suggestion, do not hesitate to send us an e-mail:
help@w3schools.com