Phase 4 — Allowed
This file is the gauge for everything in phase4/. Do not use anything outside this list.
Learning goal
Complete the box model, make declared sizes predictable, and add responsive size constraints to Phase 3 layouts.
HTML tags allowed
Document structure
htmlheadtitlebodyheadermainsectionarticleasidefooterlink(stylesheet only)
Content / controls
divph1,h2,h3,h4,h5,h6imgfigure,figcaptioninputbuttonul,ol,linava
CSS properties allowed
Everything from Phase 3:
marginpaddingfont-sizefont-weightwidthheightbackgrounddisplayborderborder-radiuscolortext-alignjustify-content
New in Phase 4:
box-sizingmin-widthmax-widthmin-heightmax-height
Allowed values and units
display:block,inline-block,none,flexbox-sizing:content-box,border-boxjustify-content:flex-start,flex-end,center,space-between,space-around,space-evenly- Sizes may use
px,%, orautowhere valid.
Not allowed
- JavaScript
- Any HTML tag not listed above
- Any CSS property not listed above
align-items,gap,flex-direction,flex-wrap,overflow, media queries, and inline styles
Box-model rules
- Read every box from inside out: content → padding → border → margin.
- Under
content-box, padding and border are added outsidewidthandheight. - Under
border-box, padding and border are included insidewidthandheight. - Margin always remains outside the declared dimensions.
- Prefer
width: 100%withmax-widthfor containers that may shrink. - Use
min-widthcautiously because it can force overflow. - Prefer
min-heightwhen content may grow. - Do not put changing text in a restrictive
max-heightwhileoverflowis unavailable.
Attributes allowed
- On
html:lang - On
link:rel,href - On
a:href - On elements:
class,idwhen used for labelling or fragment links - On landmarks and sections:
aria-label,aria-labelledby - On
img:src,alt,width,height - On
input:type,name,id,placeholder,value,min,checked,readonly - On
button:type
Applicable rules from ./rules.html
- Rules 1–8: spacing, centering, inline content, display, and Flexbox
- Rules 11–13: inheritance, DRY CSS, and relative paths
- Rules 15–19: accessible image alternatives
- Rule 32: page language
- Rules 54–57: complete box model and constrained sizing
- Rules 72–80: semantic landmarks, content relationships, and headings
Pages
01-box-model.html— comparecontent-boxandborder-box02-responsive-sizing.html— width/height constraints03-responsive-cards.html— apply those constraints to Flexbox cards