Hla mus rau cov ntsiab lus tseem ceeb Hla mus rau docs navigation
in English

Vertical alignment

Yooj yim hloov txoj kab ntsug ntawm inline, inline-block, inline-table, thiab cov ntsiab lus ntawm tes.

Hloov cov kev sib raug zoo ntawm cov khoom siv nrog cov vertical-alignmentkhoom siv. Thov nco ntsoov tias ntsug-txhim kho tsuas yog cuam tshuam rau hauv kab, inline-block, inline-table, thiab cov ntsiab lus ntawm tes.

Xaiv los ntawm .align-baseline, .align-top, .align-middle, .align-bottom, .align-text-bottom, thiab .align-text-topraws li xav tau.

Txhawm rau vertically nruab nrab cov ntsiab lus tsis-inline (xws li <div>s thiab ntau dua), siv peb cov khoom siv hluav taws xob flex .

Nrog cov ntsiab lus inline:

lub hauv paus saum nruab nrab hauv qab ntawv-sab saum toj ntawv-hauv qab
<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>

Nrog lub rooj cell:

hauv paus saum nruab nrab hauv qab ntawv-top ntawv-hauv qab
<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>

Sass

Utilities API

Vertical align utilities tau tshaj tawm hauv peb cov khoom siv hluav taws xob API hauv scss/_utilities.scss. Kawm paub siv cov khoom siv hluav taws xob API li cas.

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