Phase 5 — Allowed
This file is the gauge for everything in phase5/. Do not use anything outside this list.
Learning goal
Choose CSS units intentionally and control what happens when constrained content does not fit.
HTML tags allowed
html,head,title,body,header,main,footer,linknav,section,article,asidediv,ph1,h2,h3,h4,h5,h6img,figure,figcaptioninput,buttonul,ol,lia
Semantic labelling attributes from Phase 4 remain available.
CSS properties allowed
Everything from Phase 4:
margin,paddingfont-size,font-weightwidth,min-width,max-widthheight,min-height,max-heightbackground,displayborder,border-radius,colortext-align,justify-contentbox-sizing
New in Phase 5:
overflow
Units allowed
px%rememvh,vwsvh,svwlvh,lvwdvh,dvw- Unitless
0and valid keywords such asauto
Overflow values allowed
visiblehiddenautoscroll
Not allowed
- JavaScript
- Any HTML tag or CSS property not listed above
overflow-x,overflow-yalign-items,gap,flex-direction,flex-wrap- Media queries and inline styles
Learning rules
- Use
pxwhen a deliberate fixed reference size is useful. - Use
%when sizing should follow a containing block. - Use
remfor root-relative page spacing and type. - Use
emwhen a component should scale with its text. - Use viewport units only when the viewport should control the result.
- Prefer
svhwhen content must fit with mobile browser controls visible. - Prefer
dvhwhen a section should track the changing visible viewport. - Use
overflow: autowhen excess content must remain reachable. - Use
overflow: hiddenonly when clipping is intentional and safe.
Pages
01-units.html— comparepx,%,rem, andem02-viewport-units.html— compare classic and modern viewport units03-overflow.html— compare all four overflow values