2021-05-21 (39์ผ์ฐจ) float-grid, ๋ฐ์ค ์ ๋๋ฉ์ด์ , flex, flex-grow, ์์ง์ ๋ ฌ๋ฐฉ๋ฒ align-items, align-self, ๋ฒํผ๋ง๋ค๊ธฐ
149๊ฐ~150๊ฐ
- float-grid
.float-grid::after { content:""; display:block; clear:both; }
.float-grid > * { float:left; box-sizing:border-box; }
- ๋ฐ์ค ์ ๋๋ฉ์ด์
1) ์ข > ์ฐ
ํจ๊ณผ๋ฅผ ์ฃผ๊ณ ์ถ์ ํ๊ทธ์ ๋ค or ์์ absolute๋ฅผ ๋์ฃผ๊ธฐ
ex) ํ๊ทธ::after { content:""; background-color:white; width:0; height:2px;
position:absolute; bottom:0; left:0; transition:width .3s; }
:hover > a::after { width:100%; }
2) ๊ฐ์ด๋ฐ > ์์ชฝ
ํจ๊ณผ๋ฅผ ์ฃผ๊ณ ์ถ์ ํ๊ทธ์ ๋ค or ์์ absolute๋ฅผ ๋์ฃผ๊ธฐ
ex) ํ๊ทธ::after { content:""; background-color:white; width:0; height:2px
position:absolute; bottom:0; left:50%; transform:translateX(-50%); transition:width .3s; }
:hover > a::after { width:100%; }
<flex>
- display : flex
์์๋ค์ ์์ผ๋ก ๋์ด์ํจ๋ค
→ ์์๋ค์ ๋ถ๋ชจ์ ๋์ด๋ฅผ ๋ฐ๋ผ๊ฐ
โป inline์์๋ ๋์ด๊ฐ์ด ์ ์ฉ๋์ง ์๋๋ค.
- flex-grow : 1;
๋๋น๋ฅผ ์ต๋ํ ๋ํ์ค๋ค
= ๋จ์ ์ฌ๋ฐฑ์ ๋ค ์ฑ์์ค๋ค
- ์์ง์ ๋ ฌํ๋ ๋ฐฉ๋ฒ
๋ถ๋ชจ์๊ฒ display:flex ๊ฐ๊ณผ align-items:center๊ฐ์ ์ฃผ๊ธฐ
align-items์ ๊ธฐ๋ณธ๊ฐ์ stretch์ด๋ค
โป flex๋ก ์๋จ๋ฐ๋ฅผ ๋ง๋ค์ด์ ์์ง์ ๋ ฌ์ ์ด๋ฏธ ๋ค ๋ง์ถฐ์ ธ์๋ ์ํฉ์ผ ๋,
๊ตณ์ด ๋ฉ๋ด ์์ดํ ๋ค์๊ฒ ์, ์๋ padding์ ์, ์๋์๋ ์ฃผ์ง ์์๋ ๋๋ค
- ๋ฒํผ๋ง๋ค๊ธฐ(์๋ฅ์ ์ถํ๊ธฐ)
emmet : a.top-bar__btn-go-submit-page{์๋ฅ์ ์ถํ๊ธฐ}
๋ฒํผ๋ง ํผ์ ๊ฐ์ด๋ฐ ์์ถ๋์ด ๊ฐ๊ฒ ํ๊ธฐ ์ํ์ฌ align-self๋ก ์ฃผ๊ธฐ
top-bar__btn-go-submit-page { align-self : center; }