Problem: Form Field Rhythm Enforcer
Problem description
You have a simple form with multiple <label> and <input> pairs. Your task is to define a CSS custom property for a 2rem rhythm unit and apply it to the line-height and bottom margin of each <label> and <input>, ensuring consistent vertical spacing throughout the form.
Goal
Use only HTML and CSS to:
Define
--rhythmas 2rem in:root.Apply
line-height: var(--rhythm);andmargin-bottom: var(--rhythm);to all<label>and<input>elements.
Constraints
Only CSS is allowed.
Use rem units and CSS variables.
CSS file must be named
styles.css.Do not alter the HTML structure or add inline styles.
Sample visual output
Here’s what the output would look like:
Good luck trying the problem! If you’re unsure how to proceed, check the Solution.
Problem: Form Field Rhythm Enforcer
Problem description
You have a simple form with multiple <label> and <input> pairs. Your task is to define a CSS custom property for a 2rem rhythm unit and apply it to the line-height and bottom margin of each <label> and <input>, ensuring consistent vertical spacing throughout the form.
Goal
Use only HTML and CSS to:
Define
--rhythmas 2rem in:root.Apply
line-height: var(--rhythm);andmargin-bottom: var(--rhythm);to all<label>and<input>elements.
Constraints
Only CSS is allowed.
Use rem units and CSS variables.
CSS file must be named
styles.css.Do not alter the HTML structure or add inline styles.
Sample visual output
Here’s what the output would look like:
Good luck trying the problem! If you’re unsure how to proceed, check the Solution.