position: fixed; do in CSS?position: fixed; makes an element stay in the same place on the screen even when you scroll. It is fixed relative to the browser window.
position: sticky; behave?position: sticky; makes an element act like relative until you scroll past it, then it sticks to a position (like the top) and stays visible while scrolling.
position: sticky; work?You must set an offset like top, left, right, or bottom to tell the sticky element where to stick.
position: fixed; elements move when you scroll the page?No. Fixed elements stay in the same spot on the screen regardless of scrolling.
position: sticky;?Sticky is often used for headers or menus that stay visible at the top as you scroll down a page.
position: fixed; when you scroll the page?Fixed elements stay fixed relative to the viewport and do not move when scrolling.
position: sticky; to work?Sticky elements need an offset like top to know where to stick.
sticky makes the element stick after scrolling past it.
fixed positions the element relative to the viewport and removes it from normal flow.
position: sticky; work without setting any offset like top?Sticky requires an offset property to know where to stick.
position: fixed; and position: sticky;.position: sticky; on a website.