📦 Display Properties Explorer
Experiment with different display values and see their behavior:
inline-block
Elements sit inline but can have width/height set. Great for navigation items and buttons.
- ✓ Respects width and height
- ✓ Sits on same line as other inline elements
- ✓ Respects top/bottom margins and padding
🎯 Position Properties Playground
Learn how different position values affect element placement:
Relative Positioning
Element is positioned relative to its normal position. Original space is preserved.
🌊 Float and Clear Demonstration
Understand how floating elements affect document flow:
This is text content that flows around the floated element. When an element is floated, it's removed from the normal document flow and positioned to the left or right of its containing element. The text content will wrap around the floated element.
This paragraph can be cleared to prevent it from wrapping around the floated element. The clear property specifies which sides of an element floating elements are not allowed.
📐 Box Model in Layout Context
See how box model properties affect layout and spacing:
Adjust Box Properties:
💧 Overflow Behavior
Control what happens when content exceeds its container:
This is line 1 of content that may overflow the container.
This is line 2 of content that may overflow the container.
This is line 3 of content that may overflow the container.
This is line 4 of content that may overflow the container.
This is line 5 of content that may overflow the container.
This is line 6 of content that may overflow the container.
This is line 7 of content that may overflow the container.
This is line 8 of content that may overflow the container.
This is line 9 of content that may overflow the container.
This is line 10 of content that may overflow the container.
Current Behavior:
With overflow-x: visible and overflow-y: visible, content extends beyond the container boundaries.
🏗️ Stacking Context & Z-Index
Learn how elements stack and how to control layering:
Control Element Layers:
Z-Index: 1
Z-Index: 2
Z-Index: 3
Stacking Order Rules:
- Higher z-index values appear on top
- Elements must have position other than static
- Parent stacking context affects child elements
- Elements in the same stacking context use source order
💪 Layout Challenge
Create a classic webpage layout using the positioning techniques you've learned:
Your Task:
Arrange the elements below to create a traditional webpage layout:
- Header at the top (full width)
- Navigation below header
- Main content area on the left
- Sidebar on the right
- Footer at the bottom (full width)
📚 Layout Quick Reference
Display Properties
block- Full width, new lineinline- Flows with textinline-block- Inline but accepts dimensionsflex- Flexible box layoutgrid- Grid containernone- Removes from layout
Position Values
static- Normal document flowrelative- Relative to normal positionabsolute- Relative to positioned ancestorfixed- Relative to viewportsticky- Toggles between relative and fixed
Float & Clear
float: left/right- Float elementclear: left/right/both- Clear floats- Use clearfix for container height
- Modern layouts prefer Flexbox/Grid
Common Layout Patterns
- Header-Content-Footer: Basic page structure
- Sidebar Layout: Content + aside
- Card Grid: Repeating content blocks
- Sticky Navigation: Fixed header