Hướng dẫn bootstrap 5.1 vertical align - bootstrap 5.1 căn dọc

class="align-baseline">baseline class="align-top">top class="align-middle">middle class="align-bottom">bottom class="align-text-top">text-top class="align-text-bottom">text-bottom

Thay đổi sự liên kết của các yếu tố với các tiện ích vertical-alignment.Xin lưu ý rằng ALign dọc chỉ ảnh hưởng đến nội tuyến, khối nội tuyến, bảng nội tuyến và các phần tử ô bảng.

Chọn từ .align-baseline, .align-top, .align-middle, .align-bottom,

<table style="height: 100px;">
  <tbody>
    <tr>
      <td class="align-baseline">baselinetd>
      <td class="align-top">toptd>
      <td class="align-middle">middletd>
      <td class="align-bottom">bottomtd>
      <td class="align-text-top">text-toptd>
      <td class="align-text-bottom">text-bottomtd>
    tr>
  tbody>
table>
0 và
<table style="height: 100px;">
  <tbody>
    <tr>
      <td class="align-baseline">baselinetd>
      <td class="align-top">toptd>
      <td class="align-middle">middletd>
      <td class="align-bottom">bottomtd>
      <td class="align-text-top">text-toptd>
      <td class="align-text-bottom">text-bottomtd>
    tr>
  tbody>
table>
1 khi cần thiết.

Để tập trung vào nội dung phi dòng theo chiều dọc (như

<table style="height: 100px;">
  <tbody>
    <tr>
      <td class="align-baseline">baselinetd>
      <td class="align-top">toptd>
      <td class="align-middle">middletd>
      <td class="align-bottom">bottomtd>
      <td class="align-text-top">text-toptd>
      <td class="align-text-bottom">text-bottomtd>
    tr>
  tbody>
table>
2 và hơn thế nữa), hãy sử dụng các tiện ích hộp flex của chúng tôi.

Với các yếu tố nội tuyến:

baselinetopmiddlebottomtext-toptext-bottom top middle bottom text-top text-bottom

<span class="align-baseline">baselinespan>
<span class="align-top">topspan>
<span class="align-middle">middlespan>
<span class="align-bottom">bottomspan>
<span class="align-text-top">text-topspan>
<span class="align-text-bottom">text-bottomspan>

Với các ô bảng:

đường cơ sởđứng đầuở giữađáyText-Topvăn bản đáy

<table style="height: 100px;">
  <tbody>
    <tr>
      <td class="align-baseline">baselinetd>
      <td class="align-top">toptd>
      <td class="align-middle">middletd>
      <td class="align-bottom">bottomtd>
      <td class="align-text-top">text-toptd>
      <td class="align-text-bottom">text-bottomtd>
    tr>
  tbody>
table>

Sass

API tiện ích

Các tiện ích căn chỉnh dọc được khai báo trong API tiện ích của chúng tôi trong

<table style="height: 100px;">
  <tbody>
    <tr>
      <td class="align-baseline">baselinetd>
      <td class="align-top">toptd>
      <td class="align-middle">middletd>
      <td class="align-bottom">bottomtd>
      <td class="align-text-top">text-toptd>
      <td class="align-text-bottom">text-bottomtd>
    tr>
  tbody>
table>
3.Tìm hiểu cách sử dụng API Tiện ích.

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

Dễ dàng thay đổi sự liên kết dọc của nội tuyến, khối nội tuyến, bảng nội tuyến và các phần tử ô bảng.

Thay đổi sự liên kết của các yếu tố với các tiện ích vertical-alignment.Xin lưu ý rằng ALign dọc chỉ ảnh hưởng đến nội tuyến, khối nội tuyến, bảng nội tuyến và các phần tử ô bảng.

Chọn từ .align-baseline, .align-top, .align-middle, .align-bottom,

<table style="height: 100px;">
  <tbody>
    <tr>
      <td class="align-baseline">baselinetd>
      <td class="align-top">toptd>
      <td class="align-middle">middletd>
      <td class="align-bottom">bottomtd>
      <td class="align-text-top">text-toptd>
      <td class="align-text-bottom">text-bottomtd>
    tr>
  tbody>
table>
0 và
<table style="height: 100px;">
  <tbody>
    <tr>
      <td class="align-baseline">baselinetd>
      <td class="align-top">toptd>
      <td class="align-middle">middletd>
      <td class="align-bottom">bottomtd>
      <td class="align-text-top">text-toptd>
      <td class="align-text-bottom">text-bottomtd>
    tr>
  tbody>
table>
1 khi cần thiết.

Với các yếu tố nội tuyến:

baselinetopmiddlebottomtext-toptext-bottom top middle bottom text-top text-bottom

 class="align-baseline">baseline
 class="align-top">top
 class="align-middle">middle
 class="align-bottom">bottom
 class="align-text-top">text-top
 class="align-text-bottom">text-bottom

Với các ô bảng:

đường cơ sởđứng đầuở giữađáyText-Topvăn bản đáy

 style="height: 100px;">