ข้ามไปยังเนื้อหา

เครื่องมือสร้าง Flexbox

จัดเลย์เอาต์ flex ที่ใช้งานจริง ปรับคอนเทนเนอร์และแต่ละรายการ ทดลองความกว้างต่าง ๆ แล้วนำโค้ด CSS, HTML หรือ Tailwind ไปใช้

ตัวอย่างแบบเรียลไทม์

960 × 320 px · เลือกรายการในตัวอย่างเพื่อแก้ไข

รายการ 1
รายการ 2
รายการ 3

รายการ

สูงสุด 12 รายการ ต้องมีอย่างน้อยหนึ่งรายการ

.container {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: flex-start;
  align-items: stretch;
  align-content: stretch;
  gap: 16px;
  padding: 24px;
  height: 320px;
  box-sizing: border-box;
}

.item-1 {
  flex-grow: 1;
  flex-shrink: 1;
  flex-basis: 180px;
  order: 0;
  align-self: auto;
  min-width: 0;
  padding: 16px;
  box-sizing: border-box;
  border-radius: 12px;
  overflow-wrap: anywhere;
  background: #dbeafe;
  color: #172554;
}

.item-2 {
  flex-grow: 1;
  flex-shrink: 1;
  flex-basis: 180px;
  order: 0;
  align-self: auto;
  min-width: 0;
  padding: 16px;
  box-sizing: border-box;
  border-radius: 12px;
  overflow-wrap: anywhere;
  background: #bfdbfe;
  color: #172554;
}

.item-3 {
  flex-grow: 1;
  flex-shrink: 1;
  flex-basis: 180px;
  order: 0;
  align-self: auto;
  min-width: 0;
  padding: 16px;
  box-sizing: border-box;
  border-radius: 12px;
  overflow-wrap: anywhere;
  background: #93c5fd;
  color: #172554;
}

ข้อมูลทั้งหมดอยู่ในเบราว์เซอร์ของคุณ

แหล่งอ้างอิงรูปแบบไฟล์

อัปเดตหน้าเครื่องมือเมื่อ: