[CSS] Flexbox

dewdewΒ·2022λ…„ 5μ›” 18일
1

HTML, CSS

λͺ©λ‘ 보기
4/4

πŸ˜™ Flexbox μ™„μ „ 정리!

1. μš°μ„  Container 와 κ·Έ μ•ˆμ˜ items 에 μ μš©ν•  수 μžˆλŠ” 속성 값듀이 λ‹€λ₯΄λ‹€λŠ” 것을 μΈμ§€ν•˜μž.
2. 쀑심좕과 λ°˜λŒ€μΆ•μœΌλ‘œ λ‚˜λˆ μ§„λ‹€. λ‚΄κ°€ 쀑심좕을 μ–΄λ””λ‘œ λ‘λŠ” 지에 따라 λ°˜λŒ€μΆ•μ΄ 바뀐닀.

container

  • display - flex둜 μ •μ˜
	display: flex;
  • flex-direction
	flex-direction: row; (default)
  • flex-wrap - ν•œ 쀄에 가득 μ°¨λ©΄ λ‹€μŒ μ€„λ‘œ λ„˜μ–΄κ°€κ²Œ ν•  건지
	flex-wrap: nowrap; (default)
  • justify-content -쀑심좕 κΈ°μ€€μœΌλ‘œ 배치
	justify-content: flex-start; center;
    				 space-around; space-evenly; space-between;
  • align-items -λ°˜λŒ€μΆ• κΈ°μ€€μœΌλ‘œ 배치
	align-items: center;
    			 baseline; (textκ°€ λ‚˜λž€νžˆ 배치)
  • align-content - justify-content 와 μ‚¬μš©λ²• 동일 (근데 λ°˜λŒ€μΆ•!)

items

  • order
  • flex-grow -μ»¨ν…Œμ΄λ„ˆκ°€ λŠ˜μ–΄λ‚  λ•Œ λΉ„μœ¨ 지정
	flex-grow: 0; (default)
  • flex-shrink -μ»¨ν…Œμ΄λ„ˆκ°€ 쀄어듀 λ•Œ λΉ„μœ¨ 지정
	flex-shrink: 0; (default)
  • flex-basis -μ•„μ΄ν…œλ³„ λΉ„μœ¨μ„ 지정. grow와 shrink λ™μ‹œμ— 지정 효과
	flex-basis: 60%; (μ˜ˆμ‹œ)
  • align-self -μ•„μ΄ν…œλ³„ 배치
	align-self: center;

μ°Έκ³  μ‚¬μ΄νŠΈ 🐀
https://css-tricks.com/snippets/css/a-guide-to-flexbox/

MDN 🐽
https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Flexible_Box_Layout/Basic_Concepts_of_Flexbox

좜처 😎
https://www.youtube.com/watch?v=7neASrWEFEM
λ“œλ¦Όμ½”λ”©μ˜ 유튜브λ₯Ό 보고 μ •λ¦¬ν•œ 자료 μž…λ‹ˆλ‹€!
유튜브λ₯Ό λ³΄μ‹œλ©΄ 훨씬 더 잘 이해될 κ²λ‹ˆλ‹€ γ…Žγ…Žγ…Ž

profile
μƒˆλ‘œμš΄ 것은 늘 μ§œλ¦Ών•΄

0개의 λŒ“κΈ€