๐Ÿ“ฆ Chango/๐Ÿฃ EDOC

[CSS] Flexbox Froggy ํ’€๋ฉด์„œ CSS flexbox ๊ณต๋ถ€ํ•˜๊ธฐ

์„ ๋‹ฌ 2021. 4. 29. 18:11
๋ฐ˜์‘ํ˜•

1. justify-content

: ์š”์†Œ๋“ค์„ ๊ฐ€๋กœ์„ ์ƒ์— ์ •๋ ฌ

justify-content : flex-start	//์™ผ์ชฝ์œผ๋กœ ์ •๋ ฌ
justify-content : flex-end	//์˜ค๋ฅธ์ชฝ์œผ๋กœ ์ •๋ ฌ
justify-content : center	//๊ฐ€์šด๋ฐ ์ •๋ ฌ
justify-content : space-between	//์š”์†Œ ์‚ฌ์ด ๋™์ผํ•œ ๊ฐ„๊ฒฉ
justify-content : space-around	//์š”์†Œ ์ฃผ์œ„์— ๋™์ผํ•œ ๊ฐ„๊ฒฉ

 

2. align-items

: ์š”์†Œ๋“ค์„ ์„ธ๋กœ์„ ์ƒ์— ์ •๋ ฌ

align-items : flex-start	//๊ผญ๋Œ€๊ธฐ์— ์ •๋ ฌ
align-items : flex-end		//๋ฐ”๋‹ฅ์— ์ •๋ ฌ
align-items : center		//๊ฐ€์šด๋ฐ ์ •๋ ฌ
align-items : baseline		//์‹œ์ž‘์œ„์น˜์— ์ •๋ ฌ
align-items : stretch		//์ปจํ…Œ์ด๋„ˆ์— ๋งž๊ฒŒ ๋Š˜๋ฆฌ๊ธฐ

 

 

3. flex-direction

: ์š”์†Œ๋“ค์„ ์ •๋ ฌํ•˜๋Š” ๋ฐฉํ–ฅ์„ ์ง€์ •

flex-direction : row		//๊ฐ€๋กœ๋กœ ์ •๋ ฌ
flex-direction : row-reverse	//๊ฐ€๋กœ๋กœ ๊ฑฐ๊พธ๋กœ
flex-direction : column		//์„ธ๋กœ๋กœ ์ •๋ ฌ
flex-direction : column 	//์„ธ๋กœ๋กœ ๊ฑฐ๊พธ๋กœ

 

4. order

: ์š”์†Œ์˜ ์ˆœ์„œ ์ง€์ •

.whkakrkr {
order : 3	//์˜ค๋ฅธ์ชฝ์œผ๋กœ 3์นธ
order : -3	//์™ผ์ชฝ์œผ๋กœ 3์นธ
}

 

5. -self

: ํ•ด๋‹น ์š”์†Œ์—๋งŒ ์˜ํ–ฅ์„ ๋ฏธ์นจ

.whkakrkr {
align-self : flex-bottom	//whkakrkr๋งŒ ์„ธ๋กœ๋กœ ๋งจ ์•ผ๋ž˜ ์ •๋ ฌ
}

 

6. flex-wrap

: ์š”์†Œ ๋‚˜์—ด ์ค„ ์ˆ˜ ์„ค์ •

flex-wrap : nowrap		//ํ•œ์ค„์— ์ •๋ ฌ
flex-wrap : wrap		//์—ฌ๋Ÿฌ์ค„์— ์ •๋ ฌ
flex-wrap : wrap-reverse	//์—ฌ๋Ÿฌ์ค„์— ๊ฑฐ๊พธ๋กœ ์ •๋ ฌ

 

7. flex-flow

= flex-direction + flex-wrap

flex-flow :  row-reverse wrap	//์—ฌ๋Ÿฌ์ค„์— ๊ฑธ์ณ ๊ฐ€๋กœ๋กœ ๊ฑฐ๊พธ๋กœ ์ •๋ ฌ
flex-flow : column nowrap	//ํ•œ์ค„์— ์„ธ๋กœ๋กœ ์ •๋ ฌ

 

8. align-contents

: ์ปจํ…Œ์ด๋„ˆ ์‚ฌ์ด์˜ ๊ฐ„๊ฒฉ (์ค„)

align-content : flex-start	//๊ผญ๋Œ€๊ธฐ์— ์ •๋ ฌ
align-content : flex-end		//๋ฐ”๋‹ฅ์— ์ •๋ ฌ
align-content : center		//๊ฐ€์šด๋ฐ ์ •๋ ฌ
align-content : space-between	//์ค„์‚ฌ์ด ๊ฐ™์€ ๊ฐ„๊ฒฉ
align-content : space-around	//์ค„์‚ฌ์ด ๊ฐ™์€ ๊ฐ„๊ฒฉ
align-content : stretch		//์—ฌ๋Ÿฌ ์ค„๋“ค์„ ์ปจํ…Œ์ด๋„ˆ์— ๋งž๊ฒŒ ๋Š˜๋ฆฌ๊ธฐ

 

 

๋ฐ˜์‘ํ˜•