λ²ˆμ™Έ) Flexbox Froggy🐸

μ •μš°μ‹œΒ·2022λ…„ 5μ›” 23일
1

단계 1 of 24

justify-content: flex-end; 속성을 μ΄μš©ν•˜μ—¬ ν•΄λ‹Ή 문제λ₯Ό ν•΄κ²°ν•˜μ˜€μŠ΅λ‹ˆλ‹€.

justify-content

  • flex-start: μš”μ†Œλ“€μ„ μ»¨ν…Œμ΄λ„ˆμ˜ μ™Όμͺ½μœΌλ‘œ μ •λ ¬ν•©λ‹ˆλ‹€.
  • flex-end: μš”μ†Œλ“€μ„ μ»¨ν…Œμ΄λ„ˆμ˜ 였λ₯Έμͺ½μœΌλ‘œ μ •λ ¬ν•©λ‹ˆλ‹€.
  • center: μš”μ†Œλ“€μ„ μ»¨ν…Œμ΄λ„ˆμ˜ κ°€μš΄λ°λ‘œ μ •λ ¬ν•©λ‹ˆλ‹€.
  • space-between: μš”μ†Œλ“€ 사이에 λ™μΌν•œ 간격을 λ‘‘λ‹ˆλ‹€.
  • space-around: μš”μ†Œλ“€ μ£Όμœ„μ— λ™μΌν•œ 간격을 λ‘‘λ‹ˆλ‹€.
#pond {
 display: flex;
 justify-content: flex-end;
}

단계 2 of 24


justify-content: center;λ₯Ό μ΄μš©ν•˜μ—¬ 문제λ₯Ό ν•΄κ²°ν•˜μ˜€μŠ΅λ‹ˆλ‹€.

justify-content

  • flex-start: μš”μ†Œλ“€μ„ μ»¨ν…Œμ΄λ„ˆμ˜ μ™Όμͺ½μœΌλ‘œ μ •λ ¬ν•©λ‹ˆλ‹€.
  • flex-end: μš”μ†Œλ“€μ„ μ»¨ν…Œμ΄λ„ˆμ˜ 였λ₯Έμͺ½μœΌλ‘œ μ •λ ¬ν•©λ‹ˆλ‹€.
  • center: μš”μ†Œλ“€μ„ μ»¨ν…Œμ΄λ„ˆμ˜ κ°€μš΄λ°λ‘œ μ •λ ¬ν•©λ‹ˆλ‹€.
  • space-between: μš”μ†Œλ“€ 사이에 λ™μΌν•œ 간격을 λ‘‘λ‹ˆλ‹€.
  • space-around: μš”μ†Œλ“€ μ£Όμœ„μ— λ™μΌν•œ 간격을 λ‘‘λ‹ˆλ‹€.
#pond {
	display: flex;
    justify-content: center;
}

단계 3 of 24


justify-content: space-around;λ₯Ό μ΄μš©ν•˜μ—¬ 문제λ₯Ό ν•΄κ²°ν•˜μ˜€μŠ΅λ‹ˆλ‹€.

#pond {
	display: flex;
    justify-content: space-around;
}

단계 4 of 24


justify-content: space-between;λ₯Ό μ΄μš©ν•˜μ—¬ 문제λ₯Ό ν•΄κ²°ν•˜μ˜€μŠ΅λ‹ˆλ‹€.

#pond {
	display: flex;
    justify-content: space-between;
}

단계 5 of 24


align-items: flex-end;λ₯Ό μ΄μš©ν•˜μ—¬ 문제λ₯Ό ν•΄κ²°ν•˜μ˜€μŠ΅λ‹ˆλ‹€.

align-items

  • flex-start: μš”μ†Œλ“€μ„ μ»¨ν…Œμ΄λ„ˆμ˜ κΌ­λŒ€κΈ°λ‘œ μ •λ ¬ν•©λ‹ˆλ‹€.
  • flex-end: μš”μ†Œλ“€μ„ μ»¨ν…Œμ΄λ„ˆμ˜ λ°”λ‹₯으둜 μ •λ ¬ν•©λ‹ˆλ‹€.
  • center: μš”μ†Œλ“€μ„ μ»¨ν…Œμ΄λ„ˆμ˜ μ„Έλ‘œμ„  μƒμ˜ κ°€μš΄λ°λ‘œ μ •λ ¬ν•©λ‹ˆλ‹€.
  • baseline: μš”μ†Œλ“€μ„ μ»¨ν…Œμ΄λ„ˆμ˜ μ‹œμž‘ μœ„μΉ˜μ— μ •λ ¬ν•©λ‹ˆλ‹€.
  • stretch: μš”μ†Œλ“€μ„ μ»¨ν…Œμ΄λ„ˆμ— λ§žλ„λ‘ λŠ˜λ¦½λ‹ˆλ‹€.
#pond {
	display: flex;
    align-items: flex-end;
}

단계 6 of 24


justify-content: center;와 align-items: center;λ₯Ό μ΄μš©ν•˜μ—¬ 문제λ₯Ό ν•΄κ²°ν•˜μ˜€μŠ΅λ‹ˆλ‹€.

#pond {
	display: flex;
    justify-content: center;
    align-items: center;
}

단계 7 of 24


justify-content: space-around;와 align-items: flex-endλ₯Ό μ΄μš©ν•˜μ—¬ 문제λ₯Ό ν•΄κ²°ν•˜μ˜€μŠ΅λ‹ˆλ‹€.

#pond {
	display: flex;
    justify-content: space-around;
    align-items: flex-end;
}

단계 8 of 24


flex-direction: row-reverseλ₯Ό μ΄μš©ν•˜μ—¬ 문제λ₯Ό ν•΄κ²°ν•˜μ˜€μŠ΅λ‹ˆλ‹€.

flex-direction

  • row: μš”μ†Œλ“€μ„ ν…μŠ€νŠΈμ˜ λ°©ν–₯κ³Ό λ™μΌν•˜κ²Œ μ •λ ¬ν•©λ‹ˆλ‹€.
  • row-reverse: μš”μ†Œλ“€μ„ ν…μŠ€νŠΈμ˜ λ°˜λŒ€ λ°©ν–₯으둜 μ •λ ¬ν•©λ‹ˆλ‹€.
  • column: μš”μ†Œλ“€μ„ μœ„μ—μ„œ μ•„λž˜λ‘œ μ •λ ¬ν•©λ‹ˆλ‹€.
  • column-reverse: μš”μ†Œλ“€μ„ μ•„λž˜μ—μ„œ μœ„λ‘œ μ •λ ¬ν•©λ‹ˆλ‹€.
#pond {
	display: flex;
    flex-direction: row-reverse;
}

단계 9 of 24


flex-direction: column;을 μ΄μš©ν•˜μ—¬ 문제λ₯Ό ν•΄κ²°ν•˜μ˜€μŠ΅λ‹ˆλ‹€.

flex-direction

  • row: μš”μ†Œλ“€μ„ ν…μŠ€νŠΈμ˜ λ°©ν–₯κ³Ό λ™μΌν•˜κ²Œ μ •λ ¬ν•©λ‹ˆλ‹€.
  • row-reverse: μš”μ†Œλ“€μ„ ν…μŠ€νŠΈμ˜ λ°˜λŒ€ λ°©ν–₯으둜 μ •λ ¬ν•©λ‹ˆλ‹€.
  • column: μš”μ†Œλ“€μ„ μœ„μ—μ„œ μ•„λž˜λ‘œ μ •λ ¬ν•©λ‹ˆλ‹€.
  • column-reverse: μš”μ†Œλ“€μ„ μ•„λž˜μ—μ„œ μœ„λ‘œ μ •λ ¬ν•©λ‹ˆλ‹€.
#pond {
	display: flex;
    flex-direction: column;
}

단계 10 of 24


flex-direction: row-reverse;와 justify-content: flex-end;λ₯Ό μ΄μš©ν•˜μ—¬ 문제λ₯Ό ν•΄κ²°ν•˜μ˜€μŠ΅λ‹ˆλ‹€.

#pond {
	display: flex;
    flex-direction: row-reverse;
    justify-content: flex-end;
}

단계 11 of 24


flex-direction: column;와 justify-content: flex-end;λ₯Ό μ΄μš©ν•˜μ—¬ 문제λ₯Ό ν•΄κ²°ν•˜μ˜€μŠ΅λ‹ˆλ‹€.

#pond {
	display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

단계 12 of 24


flex-direction: column-reverse;와 justify-content: space-between;을 μ΄μš©ν•˜μ—¬ 문제λ₯Ό ν•΄κ²°ν•˜μ˜€μŠ΅λ‹ˆλ‹€.

#pond {
	display: flex;
    flex-direction: column-reverse;
    justify-content: space-between;
}

단계 13 of 24


justify-content: center;, align-items: flex-end, flex-direction: row-reverse;λ₯Ό μ΄μš©ν•˜μ—¬ 문제λ₯Ό ν•΄κ²°ν•˜μ˜€μŠ΅λ‹ˆλ‹€.

#pond {
	display: flex;
    justify-content: center;
    align-items: flex-end;
    flex-direction: row-reverse;
}

단계 14 of 24


order: 3;을 μ΄μš©ν•˜μ—¬ 문제λ₯Ό ν•΄κ²°ν•˜μ˜€μŠ΅λ‹ˆλ‹€.

#pond {
	display: flex;
}

.yellow {
	order: 3;
}

단계 15 of 24


order: -1을 μ΄μš©ν•˜μ—¬ 문제λ₯Ό ν•΄κ²°ν•˜μ˜€μŠ΅λ‹ˆλ‹€.

#pond {
	display: flex;
}

.red {
	order: -1;
}

단계 16 of 24


align-self: flex-end;λ₯Ό μ΄μš©ν•˜μ—¬ 문제λ₯Ό ν•΄κ²°ν•˜μ˜€μŠ΅λ‹ˆλ‹€.

#pond {
	display: flex;
    align-items: flex-start;
}

.yellow {
	align-self: flex-end;
}

단계 17 of 24


order: 1;, align-self: flex-end;λ₯Ό μ΄μš©ν•˜μ—¬ 문제λ₯Ό ν•΄κ²°ν•˜μ˜€μŠ΅λ‹ˆλ‹€.

#pond {
	display: flex;
    align-items: flex-start;
}

.yellow {
	order: 1;
    align-self: flex-end;
}

단계 18 of 24


flex-wrap: wrap;λ₯Ό μ΄μš©ν•˜μ—¬ 문제λ₯Ό ν•΄κ²°ν•˜μ˜€μŠ΅λ‹ˆλ‹€.

flex-wrap

  • nowrap: λͺ¨λ“  μš”μ†Œλ“€μ„ ν•œ 쀄에 μ •λ ¬ν•©λ‹ˆλ‹€.
  • wrap: μš”μ†Œλ“€μ„ μ—¬λŸ¬ 쀄에 걸쳐 μ •λ ¬ν•©λ‹ˆλ‹€.
  • wrap-reverse: μš”μ†Œλ“€μ„ μ—¬λŸ¬ 쀄에 걸쳐 λ°˜λŒ€λ‘œ μ •λ ¬ν•©λ‹ˆλ‹€.
#pond {
	display: flex;
    flex-wrap: wrap;
}

단계 19 of 24


flex-direction: column;, flex-wrap: wrap;을 μ΄μš©ν•˜μ—¬ 문제λ₯Ό ν•΄κ²°ν•˜μ˜€μŠ΅λ‹ˆλ‹€.

#pond {
	display: flex;
    flex-direction: column;
    flex-wrap: wrap;
}

단계 20 of 24


flex-flow: column wrap;λ₯Ό μ΄μš©ν•˜μ—¬ 문제λ₯Ό ν•΄κ²°ν•˜μ˜€μŠ΅λ‹ˆλ‹€.

flex-flow

  • Shorthand property for <flex-direction> and <flex-wrap>.
flex-flow: column wrap;

단계 21 of 24


align-content: flex-start;λ₯Ό μ΄μš©ν•˜μ—¬ 문제λ₯Ό ν•΄κ²°ν•˜μ˜€μŠ΅λ‹ˆλ‹€.

align-content

  • flex-start: μ—¬λŸ¬ 쀄듀을 μ»¨ν…Œμ΄λ„ˆμ˜ κΌ­λŒ€κΈ°μ— μ •λ ¬ν•©λ‹ˆλ‹€.
  • flex-end: μ—¬λŸ¬ 쀄듀을 μ»¨ν…Œμ΄λ„ˆμ˜ λ°”λ‹₯에 μ •λ ¬ν•©λ‹ˆλ‹€.
  • center: μ—¬λŸ¬ 쀄듀을 μ„Έλ‘œμ„  μƒμ˜ κ°€μš΄λ°μ— μ •λ ¬ν•©λ‹ˆλ‹€.
  • space-between: μ—¬λŸ¬ 쀄듀 사이에 λ™μΌν•œ 간격을 λ‘‘λ‹ˆλ‹€.
  • space-around: μ—¬λŸ¬ 쀄듀 μ£Όμœ„μ— λ™μΌν•œ 간격을 λ‘‘λ‹ˆλ‹€.
  • stretch: μ—¬λŸ¬ 쀄듀을 μ»¨ν…Œμ΄λ„ˆμ— λ§žλ„λ‘ λŠ˜λ¦½λ‹ˆλ‹€.
#pond {
	display: flex;
    flex-wrap: wrap;
    align-content: flex-start;
}

단계 22 of 24


align-content: flex-end;λ₯Ό μ΄μš©ν•˜μ—¬ 문제λ₯Ό ν•΄κ²°ν•˜μ˜€μŠ΅λ‹ˆλ‹€.

#pond {
	display: flex;
    flex-wrap: wrap;
    align-content: flex-end;
}

단계 23 of 24


flex-direction: column-reverse, align-content: center;λ₯Ό μ΄μš©ν•˜μ—¬ 문제λ₯Ό ν•΄κ²°ν•˜μ˜€μŠ΅λ‹ˆλ‹€.

#pond {
	display: flex;
    flex-wrap: wrap;
    flex-direction: column-reverse;
    align-content: center;
}

단계 24 of 24


flex-flow: column-reverse wrap-reverse;, justify-content: center;, align-content: space-between;, align-self: center;λ₯Ό μ΄μš©ν•˜μ—¬ 문제λ₯Ό ν•΄κ²°ν•˜μ˜€μŠ΅λ‹ˆλ‹€.

#pond {
	display: flex;
    flex-flow: column-reverse wrap-reverse;
    justify-content: center;
    align-content: space-between;
    align-self: center;
}

정리

justify-content: Aligns flex items along the main axis.

  • flex-start (default)
  • flex-end
  • center
  • space-between
  • space-around
  • space-evenly

align-items: Aligns flex items along the cross axis.

  • flex-start
  • flex-end
  • center
  • baseline
  • stretch (default)

flex-direction: Defines the direction of the main axis.

  • row (default)
  • row-reverse
  • column
  • column-reverse

order: Specifies the order of the flex item.

  • <integer> (...-1, 0 (default), 1, ...)

align-self: Aligns a flex item along the cross axis, overriding the align-items value.

  • flex-start
  • flex-end
  • center
  • baseline
  • stretch

flex-wrap: Specifies whether flex items are forced on a single line or can be wrapped on multiple lines.

  • nowrap (default)
  • wrap
  • wrap-reverse

flex-flow: Shorthand property for flex-direction and flex-wrap.

  • <flex-direction> <flex-wrap>

align-content: Aligns a flex container's lines within the flex container when there is extra space on the cross-axis.

  • flex-start
  • flex-end
  • center
  • space-between
  • space-around
  • space-evenly
  • stretch (default)
profile
ν”„λ‘ νŠΈμ—”λ“œ κ³΅λΆ€ν•˜κ³  μžˆλŠ” μ •μš°μ‹œμž…λ‹ˆλ‹€.

0개의 λŒ“κΈ€