flex-direction

Các tiện ích để kiểm soát hướng của các mục flex.

ClassStyles
flex-row
flex-direction: row;
flex-row-reverse
flex-direction: row-reverse;
flex-col
flex-direction: column;
flex-col-reverse
flex-direction: column-reverse;

Ví dụ

Hàng

Sử dụng flex-row để định vị các mục flex theo chiều ngang cùng hướng với văn bản:

01
02
03
<div class="flex flex-row ...">  <div>01</div>  <div>02</div>  <div>03</div></div>

Hàng đảo ngược

Sử dụng flex-row-reverse để định vị các mục flex theo chiều ngang theo hướng ngược lại:

01
02
03
<div class="flex flex-row-reverse ...">  <div>01</div>  <div>02</div>  <div>03</div></div>

Cột

Sử dụng flex-col để định vị các mục flex theo chiều dọc:

01
02
03
<div class="flex flex-col ...">  <div>01</div>  <div>02</div>  <div>03</div></div>

Cột đảo ngược

Sử dụng flex-col-reverse để định vị các mục flex theo chiều dọc theo hướng ngược lại:

01
02
03
<div class="flex flex-col-reverse ...">  <div>01</div>  <div>02</div>  <div>03</div></div>

Responsive design

Prefix a flex-direction utility with a breakpoint variant like md: to only apply the utility at medium screen sizes and above:

<div class="flex flex-col md:flex-row ...">  <!-- ... --></div>

Learn more about using variants in the variants documentation.

Copyright © 2025 Tailwind Labs Inc.·Chính sách thương hiệu