メインコンテンツにスキップ ドキュメント ナビゲーションにスキップ
Check
in English

垂直方向の配置

インライン、インライン ブロック、インライン テーブル、およびテーブル セル要素の垂直方向の配置を簡単に変更します。

vertical-alignmentユーティリティを使用して要素の配置を変更します。vertical-align は inline、inline-block、inline-table、および table セル要素にのみ影響することに注意してください。

.align-baseline.align-top.align-middle.align-bottom.align-text-bottom、から必要に応じて選択し.align-text-topます。

非インライン コンテンツ ( など) を垂直方向に中央揃えするには、フレックス ボックス ユーティリティ<div>を使用します。

インライン要素の場合:

ベースライン テキスト上 テキスト下
html
<span class="align-baseline">baseline</span>
<span class="align-top">top</span>
<span class="align-middle">middle</span>
<span class="align-bottom">bottom</span>
<span class="align-text-top">text-top</span>
<span class="align-text-bottom">text-bottom</span>

表セルの場合:

ベースライン 真ん中 テキストトップ テキスト下部
html
<table style="height: 100px;">
  <tbody>
    <tr>
      <td class="align-baseline">baseline</td>
      <td class="align-top">top</td>
      <td class="align-middle">middle</td>
      <td class="align-bottom">bottom</td>
      <td class="align-text-top">text-top</td>
      <td class="align-text-bottom">text-bottom</td>
    </tr>
  </tbody>
</table>

サス

ユーティリティ API

Vertical align ユーティリティは、 のユーティリティ API で宣言されていますscss/_utilities.scssユーティリティ API の使用方法を学びます。

    "align": (
      property: vertical-align,
      class: align,
      values: baseline top middle bottom text-bottom text-top
    ),