About 10796 letters
About 54 minutes
In CSS, the position
property is used to specify how an element is positioned, determining its behavior in the document flow and what it is positioned relative to.
Value | Description | Removed from Document Flow |
---|---|---|
static | Default value. Elements are laid out in the normal document flow. | No |
relative | Offsets the element relative to its normal position; often used as a reference for absolute positioning. | No |
absolute | Positioned relative to the nearest non-static ancestor. | Yes |
fixed | Positioned relative to the viewport (does not move when scrolling). | Yes |
sticky | “Sticks” to a defined position during scroll. |
staticOne day, a bored Alice was sitting with her sister by the riverbank. Suddenly, a strangely dressed white rabbit ran by, holding a pocket watch and muttering to itself in a hurry.
Curious, Alice followed the rabbit and jumped into its hole. The hole was very deep, and after a long fall, Alice finally landed. She found herself in a strange hall filled with doors of all sizes, all locked.
She found a key that opened only a tiny door. The door was too small to pass through, but she saw a beautiful garden beyond it.
She placed the key on a table and found a bottle labeled "Drink Me".
Without hesitation, Alice drank it, shrank, and could now pass through the door—but couldn’t reach the key again.
position:static;
In a panic, she found a cake labeled “Eat Me”. After eating it, she grew so big that her head hit the ceiling.
Alice began to cry, flooding the hall with her tears.
She accidentally picked up a fan, which caused her to shrink again, and she had to swim through her own tears.
Along the way, she met a swimming mouse.
Trying to chat, Alice kept mentioning her pet cat Dinah, which naturally upset the mouse.
Her tears swept away other animals and birds; soon, she was surrounded by a group of them.
They gathered by the shore to discuss how to dry off.
The mouse gave a long lecture about William the Conqueror, which Alice found extremely boring. The Dodo suggested a nonsensical race where everyone ran in circles with no winner.
Still confused, Alice again mentioned her cat, scaring off all the animals.
absoluteOne day, a bored Alice was sitting with her sister by the riverbank. Suddenly, a strangely dressed white rabbit ran by, holding a pocket watch and muttering to itself in a hurry.
Curious, Alice followed the rabbit and jumped into its hole. The hole was very deep, and after a long fall, Alice finally landed. She found herself in a strange hall filled with doors of all sizes, all locked.
She found a key that opened only a tiny door. The door was too small to pass through, but she saw a beautiful garden beyond it.
She placed the key on a table and found a bottle labeled "Drink Me".
Without hesitation, Alice drank it, shrank, and could now pass through the door—but couldn’t reach the key again.
position:absolute;
top: 50px;
left: 50px;In a panic, she found a cake labeled “Eat Me”. After eating it, she grew so big that her head hit the ceiling.
Alice began to cry, flooding the hall with her tears.
She accidentally picked up a fan, which caused her to shrink again, and she had to swim through her own tears.
Along the way, she met a swimming mouse.
Trying to chat, Alice kept mentioning her pet cat Dinah, which naturally upset the mouse.
Her tears swept away other animals and birds; soon, she was surrounded by a group of them.
They gathered by the shore to discuss how to dry off.
The mouse gave a long lecture about William the Conqueror, which Alice found extremely boring. The Dodo suggested a nonsensical race where everyone ran in circles with no winner.
Still confused, Alice again mentioned her cat, scaring off all the animals.
fixedOne day, a bored Alice was sitting with her sister by the riverbank. Suddenly, a strangely dressed white rabbit ran by, holding a pocket watch and muttering to itself in a hurry.
Curious, Alice followed the rabbit and jumped into its hole. The hole was very deep, and after a long fall, Alice finally landed. She found herself in a strange hall filled with doors of all sizes, all locked.
She found a key that opened only a tiny door. The door was too small to pass through, but she saw a beautiful garden beyond it.
She placed the key on a table and found a bottle labeled "Drink Me".
Without hesitation, Alice drank it, shrank, and could now pass through the door—but couldn’t reach the key again.
position:fixed;
top: 50px;
left: 50px;In a panic, she found a cake labeled “Eat Me”. After eating it, she grew so big that her head hit the ceiling.
Alice began to cry, flooding the hall with her tears.
She accidentally picked up a fan, which caused her to shrink again, and she had to swim through her own tears.
Along the way, she met a swimming mouse.
Trying to chat, Alice kept mentioning her pet cat Dinah, which naturally upset the mouse.
Her tears swept away other animals and birds; soon, she was surrounded by a group of them.
They gathered by the shore to discuss how to dry off.
The mouse gave a long lecture about William the Conqueror, which Alice found extremely boring. The Dodo suggested a nonsensical race where everyone ran in circles with no winner.
Still confused, Alice again mentioned her cat, scaring off all the animals.
stickyOne day, a bored Alice was sitting with her sister by the riverbank. Suddenly, a strangely dressed white rabbit ran by, holding a pocket watch and muttering to itself in a hurry.
Curious, Alice followed the rabbit and jumped into its hole. The hole was very deep, and after a long fall, Alice finally landed. She found herself in a strange hall filled with doors of all sizes, all locked.
She found a key that opened only a tiny door. The door was too small to pass through, but she saw a beautiful garden beyond it.
She placed the key on a table and found a bottle labeled "Drink Me".
Without hesitation, Alice drank it, shrank, and could now pass through the door—but couldn’t reach the key again.
position:sticky;
top: 50px;
In a panic, she found a cake labeled “Eat Me”. After eating it, she grew so big that her head hit the ceiling.
Alice began to cry, flooding the hall with her tears.
She accidentally picked up a fan, which caused her to shrink again, and she had to swim through her own tears.
Along the way, she met a swimming mouse.
Trying to chat, Alice kept mentioning her pet cat Dinah, which naturally upset the mouse.
Her tears swept away other animals and birds; soon, she was surrounded by a group of them.
They gathered by the shore to discuss how to dry off.
The mouse gave a long lecture about William the Conqueror, which Alice found extremely boring. The Dodo suggested a nonsensical race where everyone ran in circles with no winner.
Still confused, Alice again mentioned her cat, scaring off all the animals.
Created in 5/30/2025
Updated in 5/30/2025