Problem Statement
What is the difference between position: fixed and position: absolute?
Explanation
Both remove the element from normal flow, but absolute positions relative to the nearest positioned ancestor, while fixed positions relative to the viewport. Fixed elements don’t move when scrolling, whereas absolute elements scroll with their container.
Code Solution
SolutionRead Only
.menu { position: fixed; top: 0; }
.tooltip { position: absolute; top: 20px; }