Unitless line-height Recommendation Lookup
Unitless line-height inherited number recomputes with child font; contrast fixed parent used length, not specified universal 1.5 recommendation. Explicit supplied computed/layout context only; not a browser cascade/layout engine or cross-browser guarantee.
Description
A unitless line-height is a multiplier applied to the receiving element's font size.
A unitless line-height is a multiplier applied to the receiving element's font size.1
A fixed inherited length instead retains the previously computed line-box amount. Use Unitless line-height Recommendation Lookup to evaluate the supplied inputs under the specific model below.
When to use Unitless line-height Recommendation Lookup
Use Unitless line-height Recommendation Lookup to evaluate the supplied inputs under the specific model below. Define the supplied layout, token or rendering scenario and establish the relevant units and browser context independently.
How to use Unitless line-height Recommendation Lookup and understand its results
- Define the supplied layout, token or rendering scenario and establish the relevant units and browser context independently.
- Enter Unitless line height, Parent font px, Child font px using the field table and validation rules below, then run the tool.
- Read Parent line box px, Inherited child line box px, Fixed parent length inherited px and interpret units, signs, ordering and placeholders as explained below.
- If the tool reports an input error, correct that field and rerun. A successful false result, empty match list or unknown-evidence placeholder has the specific meaning described here; check the limitations before applying the result.
| Input field | Meaning | Value type | Requirement |
|---|---|---|---|
| unitlessLineHeight | Unitless line height | number | Required; constraints below |
| parentFontPx | Parent font px | number | Required; constraints below |
| childFontPx | Child font px | number | Required; constraints below |
Enter a nonnegative line-height multiplier and positive parent and child font sizes in px. Return multiplier×parent size, multiplier×child size, and the parent-derived fixed length as inherited by the child. The two child values illustrate numeric inheritance versus length inheritance; they are not a complete font-metric or line-box measurement.
parentPx = multiplier×parentFontPx; childUnitlessPx = multiplier×childFontPx; inheritedFixedPx = parentPx Field order, units and branch conditions follow the implementation explanation above.
| Output field | Meaning | Value type |
|---|---|---|
| parentLineBoxPx | Parent line box px | number |
| inheritedChildLineBoxPx | Inherited child line box px | number |
| fixedParentLengthInheritedPx | Fixed parent length inherited px | number |
{
"input": {
"unitlessLineHeight": 1.5,
"parentFontPx": 20,
"childFontPx": 10
},
"output": {
"parentLineBoxPx": 30,
"inheritedChildLineBoxPx": 15,
"fixedParentLengthInheritedPx": 30
}
} Limitations and assumptions
A fixed inherited length instead retains the previously computed line-box amount. Apply the exact scope and assumptions described above.
All listed fields require explicit values. Unexpected fields, incorrect types, nonfinite numbers and sparse arrays fail validation. Domain-specific bounds, alignments and supported tokens are stated above; extremely large inputs or outputs can also be rejected. These errors differ from successful results such as false, no matches or unknown evidence.
Alternative or Complementary methods
Use text-align:justify Last-Line Behavior for a related task: Last-line alignment can differ from the justification of preceding lines.
Use hyphens:auto Language Support Note for a related task: Automatic hyphenation depends on language and available browser dictionary support.
References
Similar or alternative tools
- text-align:justify Last-Line Behavior
Last-line alignment can differ from the justification of preceding lines.
- hyphens:auto Language Support Note
Automatic hyphenation depends on language and available browser dictionary support.