Phase 7 — Allowed
This file is the gauge for everything in phase7/. Phase 7 builds on every tool allowed through Phase 6.
Learning goal
Position elements deliberately, preserve normal flow when appropriate, and control simple overlapping layers.
Inherited tools
Everything from ./phase6-allowed.html remains available.
New CSS properties
positiontoprightbottomleftz-index
Allowed values
position:static,relative,absolute,fixed,sticky- Offsets: any unit already allowed through Phase 6,
0, orauto z-index:autoor integers
Positioning rules
staticis the default and ignorestop,right,bottom, andleft.relativekeeps its original space in normal flow, then offsets the rendered box.- A positioned element can establish the containing block for an absolutely positioned descendant.
absoluteleaves normal flow; reserve space when other content must not move underneath it.fixedis normally positioned relative to the viewport and can cover content while scrolling.stickybehaves like normal flow until an offset threshold such astop: 0is reached.- Ancestor overflow can change or prevent the expected sticky behavior.
- Source order controls which overlapping element paints later when no z-index changes the order.
- Use
z-indexonly when overlap is intentional, and prefer a small documented scale. - A z-index cannot escape its ancestor stacking context; avoid teaching large arbitrary numbers as a fix.
Not allowed
- JavaScript
insetshorthand- Transforms, opacity-based layering, and other advanced stacking-context demonstrations
- Any HTML tag or CSS property not inherited or listed above
- Media queries and inline styles
Pages
01-static-relative.html— normal flow, static positioning, and relative offsets02-absolute.html— containing blocks, absolute positioning, and anchored badges03-fixed-sticky.html— viewport-fixed controls and scroll-dependent sticky elements04-z-index.html— source order, overlap, z-index, and basic stacking contexts