Problem Statement
Which positioning keeps an element fixed relative to the viewport even when scrolling?
Explanation
The `fixed` position keeps an element pinned to the viewport, unaffected by scrolling. Commonly used for headers, navbars, or floating buttons.
Code Solution
SolutionRead Only
.navbar { position: fixed; top: 0; width: 100%; }Practice Sets
This question appears in the following practice sets:
