Demo 1: Setting the Line Height for Text Click the demo button below!
<div style="background-color: yellowgreen;">
    <input type="text">
</div>
Demo 2: Specifying the Minimum Height of an Internal Line Box Click the demo button below!
selector {
    line-height: /* value */
}
## Syntax

/* Keyword values */
line-height: normal;

/* Number values */
line-height: 1.5; /* Sets the line height to 1.5 times the current font-size */

/* Percentage values */
line-height: 150%; /* Sets the line height to 150% of the current font-size */

/* Length values */
line-height: 28px;
line-height: 2.5em;

/* The font shorthand property */
font: 25px/1.5 arial, sans-serif; /* The line-height is set to 1.5 */

/* Global values */
line-height: inherit;
line-height: initial;
line-height: revert;
line-height: revert-layer;
line-height: unset;
<style>
    p {
        background-color: yellowgreen;
    }
</style>
<p style="line-height: 500%">
    This text has a line-height of 500%.
</p>
<p style="line-height: 100px">
    This text has a line-height of 100px.
</p>
<p style="line-height: 5px">
    This text has a line-height of 5px.
</p>
Rendered Output
<style>
    p {
        background-color: yellowgreen;
        border: 2px solid red;
    }
</style>
<p style="line-height: 500px">
    <!-- Does not work when there is no inline content -->
</p>
Rendered Output
<style>
    p {
        background-color: yellowgreen;
    }
</style>
<p style="line-height: 100px">
    <input type="text" placeholder="Inline Content">
</p>
Rendered Output
<style>
    p {
        display: flex;
        background-color: yellowgreen;
    }
</style>
<p style="line-height: 100px">
    <input type="text" placeholder="Inline Content">
</p>
<p style="line-height: 100px">
    Text Content
</p>
Rendered Output
<p class="narrow">
    In vertical writing mode (such as vertical-rl),
    the line-height property determines the distance between vertical lines.
</p>
<p class="wide">
    In vertical writing mode (such as vertical-rl),
    the line-height property determines the distance between vertical lines.
</p>
p {
    border: 1px solid;
    padding: 0.6em;
    background-color: yellowgreen;
    height: 200px;
    margin-bottom: 1em;
    
    writing-mode: vertical-rl; /* Sets the text to vertical writing mode */
}
.narrow {
    line-height: 1;
}
.wide {
    line-height: 2;
}
Rendered Output