1
HTML/CSSBeginner#css#flexbox
absolute positions relative to the nearest ancestor with position other than static (or the initial containing block if none exists), and scrolls with that ancestor. fixed positions relative to the viewport (or a transformed ancestor) and stays in place during page scroll.
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.5); }
.dropdown { position: relative; }
.dropdown-menu { position: absolute; top: 100%; left: 0; }