Labels (label and for)
The <label> attribute that links the label to a specific input. Its value must exactly match the id of the target input element.
Understanding Labels (label and for) in HTML & CSS
What it does: Both for and id hold the value 'email'. If they differ - even in case - the label and input are not linked. The label describes the purpose of the password field. Screen readers announce 'Password' when the input receives focus. The for attribute holds the id of the target input. 'name' is an attribute on inputs, not labels. HTML tag names must be lowercase. <LABEL> is non-standard - use <label>. Checkboxes are small and hard to click. A linked label means the user can click the text to toggle the box.
Common mistakes: HTML tag names must be lowercase. <LABEL> and </LABEL> should be <label> and </label>. Attribute names must be lowercase. 'For' should be written as 'for': for="email".
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 21–30) and word search (Modules 21–41).
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
forFill in the Blanks
Spot the Error
Student with a class code? Join your class →