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

  1. Define the supplied layout, token or rendering scenario and establish the relevant units and browser context independently.
  2. Enter Unitless line height, Parent font px, Child font px using the field table and validation rules below, then run the tool.
  3. 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.
  4. 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 fieldMeaningValue typeRequirement
unitlessLineHeightUnitless line heightnumberRequired; constraints below
parentFontPxParent font pxnumberRequired; constraints below
childFontPxChild font pxnumberRequired; 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 fieldMeaningValue type
parentLineBoxPxParent line box pxnumber
inheritedChildLineBoxPxInherited child line box pxnumber
fixedParentLengthInheritedPxFixed parent length inherited pxnumber
json
{
  "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

  1. Unitless line-height Recommendation Lookup — tool.io

Similar or alternative tools

Don't forget to set a bookmark for tool.io!
Privacy | Imprint | Cookies