Position static is the default way elements are placed on a webpage. It means elements follow the normal flow, like blocks stacking one after another.
Position static in CSS
Start learning this pattern below
Jump into concepts and practice - no test required
or
Test this pattern10 questions across easy, medium, and hard to know if this pattern is strong
Introduction
Syntax
CSS
selector {
position: static;
}Static is the default position for all elements if you don't set position.
Top, bottom, left, and right properties do not work with position static.
Examples
CSS
div {
position: static;
}CSS
p {
position: static;
color: blue;
}Sample Program
Two colored boxes are stacked vertically because position static keeps them in normal flow.
CSS
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8" /> <meta name="viewport" content="width=device-width, initial-scale=1" /> <title>Position Static Example</title> <style> .box1 { width: 8rem; height: 8rem; background-color: lightcoral; position: static; margin-bottom: 1rem; } .box2 { width: 8rem; height: 8rem; background-color: lightseagreen; position: static; } </style> </head> <body> <main> <section> <div class="box1">Box 1</div> <div class="box2">Box 2</div> </section> </main> </body> </html>
Important Notes
Position static ignores top, bottom, left, and right properties.
Use position static when you want simple, natural layouts without manual positioning.
Summary
Position static is the default and places elements in normal page flow.
It does not allow moving elements with top, left, bottom, or right.
Use it for simple layouts where elements stack naturally.
Practice
1. What does
position: static; do to an HTML element?easy
Solution
Step 1: Understand default positioning
By default, HTML elements haveposition: static;which means they follow the normal flow of the page.Step 2: Check offset properties effect
Withposition: static;, properties liketop,leftdo not affect the element's position.Final Answer:
It places the element in the normal page flow without any offset. -> Option DQuick Check:
Default position = static = normal flow [OK]
Hint: Static means no movement, normal flow only [OK]
Common Mistakes:
- Thinking static allows moving with top or left
- Confusing static with fixed or absolute
- Assuming static removes element from flow
2. Which of the following CSS snippets correctly applies static positioning to a
div?easy
Solution
Step 1: Identify the correct property value
The CSS propertypositionaccepts values likestatic,fixed,relative, andabsolute. To apply static positioning, useposition: static;.Step 2: Match the option with static
Only div { position: static; } usesposition: static;correctly.Final Answer:
div { position: static; } -> Option CQuick Check:
Correct syntax for static = position: static [OK]
Hint: Static is the keyword 'static' in position property [OK]
Common Mistakes:
- Using fixed or absolute instead of static
- Missing the colon after position
- Using invalid property names
3. Given this HTML and CSS, what will be the vertical position of the
<div> with position: static;?
<style>
div { position: static; top: 50px; }
</style>
<div>Hello</div>medium
Solution
Step 1: Understand static position behavior with offsets
When an element hasposition: static;, offset properties liketopdo not affect its position.Step 2: Predict the visual result
Thedivremains in the normal flow and ignorestop: 50px;.Final Answer:
The div will stay in its normal position ignoring the top value. -> Option BQuick Check:
Static ignores top/left offsets [OK]
Hint: Static ignores top/left, no movement [OK]
Common Mistakes:
- Assuming top moves static elements
- Thinking static hides elements with invalid offsets
- Confusing static with relative positioning
4. You want to move a
p element 20px down using CSS, but it has position: static;. What is the problem and how to fix it?
p { position: static; top: 20px; }medium
Solution
Step 1: Identify why top has no effect
Elements withposition: static;ignore offset properties liketop, sotop: 20px;does nothing.Step 2: Choose correct positioning to allow movement
Changingpositiontorelativeenablestopto move the element 20px down.Final Answer:
Static ignores top; change position to relative to move it. -> Option AQuick Check:
Static ignores offsets; relative allows top/left [OK]
Hint: Use relative, not static, to move with top/left [OK]
Common Mistakes:
- Thinking static allows top to move elements
- Using bottom instead of top with static
- Trying to move static elements without changing position
5. You have a layout where a
header and section stack naturally. You want the section to stay in normal flow but also move 10px right using the left: 10px; property. Which CSS is best?
header { position: static; }
section { position: static; left: 10px; }hard
Solution
Step 1: Understand static position and left property
Withposition: static;, theleftproperty is ignored, soleft: 10px;won't move thesection.Step 2: Choose correct position to move element while keeping flow
Usingposition: relative;allows the element to move withleft: 10px;but still stay in the normal document flow.Final Answer:
Changesectiontoposition: relative;and keepleft: 10px;. -> Option AQuick Check:
Relative + left moves element, static ignores left [OK]
Hint: Use relative to move with left, keep flow [OK]
Common Mistakes:
- Expecting left to move static elements
- Using absolute removes element from flow
- Using margin-left instead of position for offset
