Width and height
A CSS property that sets the maximum width an element is allowed to reach. The element can be smaller but never wider. Useful for responsive layouts.
Understanding Width and height in HTML & CSS
What it does: min-height: 50vh means the section is always at least half the viewport tall. It can grow taller with content but never shorter. width: 100% makes the paragraph as wide as its parent element. On a 600px parent, it becomes 600px. max-width: 100% sets an upper limit. The image can be its natural size or smaller but never wider than the container. CSS property names are case-sensitive and must be lowercase. 'Width' is invalid — use 'width'. By default, width and height apply to the content area only. Padding and border are added on top. Use box-sizing: border-box to include them.
Common mistakes: CSS declarations require a colon. It should be width: 200px; not width 200px;. CSS declarations require a colon. It should be height: 150px; not height 150px;.
Free printable worksheet with full answer key — or add this module to a class and your students practise it interactively.
This module's key terms are also in a printable crossword (Modules 43–52) and word search (Modules 43–63).
Take this worksheet further — free with Cloodit
Each concept is reinforced from every angle — learned, then applied, then tested.
Cloodit turns curriculum-aligned coding content into journeys students work through one biome at a time.
Over 100 of them, across seven natural biomes.
Turns their work into revision material ready for Flash Cards and Exam study.
Live, competitive practice for the start of the lesson or a teacher-led lesson finisher.
Honour your top performers, or encourage a student who's trying hard — ready to print in seconds.
Quick Questions
Match the Pairs
Key Term
max-widthFill in the Blanks
Spot the Error
Student with a class code? Join your class →