Interview Question

What is position property?

position chooses static, relative, absolute, fixed, or sticky positioning.

💡 Concept ✅ Quick Revision 🎨 CSS

Answer

The position property selects the positioning scheme used for a box. • static uses normal positioning behavior. • relative, absolute, fixed, and sticky enable offsets and positioned layout rules. • Inset properties determine offsets for non-static positioned boxes.

💡 Simple Example

.notice { position: relative; inset-block-start: .5rem; }

⚡ Quick Revision

position chooses static, relative, absolute, fixed, or sticky positioning.