Complete the Position Property
Fill in the Blank Medium
Question
Fill in the blank to position this element relative to the viewport (it stays fixed on scroll).
Code
.header {
position: ___;
top: 0;
width: 100%;
}
Hint
It stays in place even when the page is scrolled.
Explanation
position: fixed positions the element relative to the viewport, so it stays in place even when the page is scrolled. position: sticky is similar but only sticks within its parent container. position: absolute is relative to the nearest positioned ancestor.
Related Resources
Related Lessons
Look up unfamiliar terms
A beginner-friendly glossary explains jargon in plain English — variables, functions, DOM, Promise, and more.
Decode error messages
Plain-English explanations of common errors — what they mean, why they happen, and how to fix them.
Build real projects
Apply what you learned by building guided projects with starter code and solutions.