Programming Exercises

Create a sticky header that remains at the top when scrolling.

Medium

Problem Statement

Create a sticky header that remains at the top when scrolling.

Sample Output

The header stays visible at the top of the page while the rest of the content scrolls.

Limits

Time: 2s · Memory: 256 MB

Code Editor
00:00
<!DOCTYPE html> <html> <head> <style> /* Add CSS here to create a sticky header */ </style> </head> <body> <header>Sticky Header</header> <div><p>Content goes here...</p></div> </body> </html>
Log in or sign up to run or submit your code.Log inSign up
Expected Output
The header stays visible at the top of the page while the rest of the content scrolls.