Problem: Fluid Paragraph Line-Height
Problem description
Given a paragraph element (<p>), write CSS rules to:
Define CSS custom properties
--min-line-height(2) and--max-line-height(3.2).Create a fluid line-height variable
--fluid-line-heightusingclamp()with acalc()interpolation between these values for viewport widths from320pxto1600px.Apply
--fluid-line-heightto the paragraph’sline-heightproperty.
Goal
Enhance readability by fluidly adjusting paragraph line-height based on viewport width without using JavaScript.
Constraints
The solution must use an external stylesheet named
styles.css.Do not use JavaScript.
Support all modern browsers.
CSS variables should be as follows:
--min-line-height: 2;--max-line-height: 3.2;
Fluid range applies between viewport widths of
320pxand1600px
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: Fluid Paragraph Line-Height
Problem description
Given a paragraph element (<p>), write CSS rules to:
Define CSS custom properties
--min-line-height(2) and--max-line-height(3.2).Create a fluid line-height variable
--fluid-line-heightusingclamp()with acalc()interpolation between these values for viewport widths from320pxto1600px.Apply
--fluid-line-heightto the paragraph’sline-heightproperty.
Goal
Enhance readability by fluidly adjusting paragraph line-height based on viewport width without using JavaScript.
Constraints
The solution must use an external stylesheet named
styles.css.Do not use JavaScript.
Support all modern browsers.
CSS variables should be as follows:
--min-line-height: 2;--max-line-height: 3.2;
Fluid range applies between viewport widths of
320pxand1600px
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.