Gå til hovedinnhold Hopp til dokumentnavigering
in English

Vertikal justering

Endre enkelt den vertikale justeringen av inline-, inline-block-, inline-tabell- og tabellcelleelementer.

Endre justeringen av elementer med vertical-alignmentverktøyene. Vær oppmerksom på at vertikal-justering bare påvirker inline-, inline-block-, inline-tabell- og tabellcelleelementer.

Velg mellom .align-baseline, .align-top, .align-middle, .align-bottom, .align-text-bottom, og .align-text-topetter behov.

For å vertikalt sentrere ikke-inline-innhold (som <div>s og mer), bruk våre flex box-verktøy .

Med innebygde elementer:

grunnlinje topp midt bunn tekst-topp tekst-bunn
<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>

Med tabellceller:

grunnlinje topp midten bunn tekst-topp tekst-bunn
<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

Vertikal align-verktøy er deklarert i vår utilities API i scss/_utilities.scss. Lær hvordan du bruker utilities API.

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