--- title: line-height-step slug: Web/CSS/line-height-step tags: - CSS - CSS フォント - CSS プロパティ - Reference - 'recipe:css-property' translation_of: Web/CSS/line-height-step --- <div>{{CSSRef}}</div> <p><strong><code>line-height-step</code></strong> は CSS のプロパティで、行ボックスの高さにおける刻みの単位を設定します。このプロパティが設定された場合、行ボックスの高さは単位の倍数のうち最も近いものに切り上げられます。</p> <pre class="brush:css no-line-numbers notranslate">/* ポイント値 */ line-height-step: 18pt; </pre> <p>{{cssinfo}}</p> <h2 id="Syntax" name="Syntax">構文</h2> <p><code>line-height-step</code> プロパティは、以下のうちの一つで指定します。</p> <ul> <li><code><a href="#<length>"><length></a></code></li> </ul> <h3 id="Values" name="Values">値</h3> <dl> <dt><a id="<length>" name="<length>"><code><length></code></a></dt> <dd>指定された {{cssxref("<length>")}} が、行ボックスの高さの刻みの計算に使用されます。</dd> </dl> <h3 id="Formal_syntax" name="Formal_syntax">形式文法</h3> {{csssyntax}} <h2 id="Examples" name="Examples">例</h2> <p id="sect1">以下の例では、それぞれの段落の行ボックスの高さは、刻みの単位に切り上げられます。 <code><h1></code> の行ボックスの高さは1つの刻みに収まらないので2つ分を占有しますが、その中の中央に配置されます。</p> <pre class="brush: css notranslate">:root { font-size: 12pt; --my-grid: 18pt; line-height-step: var(--my-grid); } h1 { font-size: 20pt; margin-top: calc(2 * var(--my-grid)); }</pre> <p>これらの規則の結果は、次のスクリーンショットのようになります。</p> <p><img alt="どのように line-height-step プロパティがテキストの表示に影響するか" src="https://mdn.mozillademos.org/files/15257/line-grid-center.png" style="height: 340px; width: 144px;"></p> <h2 id="Specifications" name="Specifications">仕様書</h2> <table class="standard-table"> <thead> <tr> <th scope="col">仕様書</th> <th scope="col">状態</th> <th scope="col">備考</th> </tr> </thead> <tbody> <tr> <td>{{SpecName('CSS Rhythmic Sizing', '#line-height-step', 'line-height-step')}}</td> <td>{{Spec2('CSS Rhythmic Sizing')}}</td> <td>初回定義</td> </tr> </tbody> </table> <h2 id="Browser_compatibility" name="Browser_compatibility">ブラウザーの互換性</h2> <p>{{Compat("css.properties.line-height-step")}}</p> <h2 id="See_also" name="See_also">関連情報</h2> <ul> <li>{{Cssxref("font")}}</li> <li>{{Cssxref("font-size")}}</li> <li>{{Cssxref("line-height")}}</li> </ul>