๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ

๐Ÿ‘ฉ๐Ÿป‍๐Ÿ’ปSTUDY/CSS

[CSS] ์ด๋ฏธ์ง€ ๋น„์œจ๊ณ„์‚ฐ

๋ฐ˜์‘ํ˜•

.gallery .board ์—์„œ 43.2% ๊ณ„์‚ฐ๋ฐฉ๋ฒ•.

 

223(์ด๋ฏธ์ง€ํ•˜๋‚˜์˜ ๋„“์ด) + 223(์ด๋ฏธ์ง€ํ•˜๋‚˜์˜ ๋„“์ด) + 20(margin-left) + 10(margin-left) = 476

476/1100*100 = 43.2727%

 

::before padding-top ๋ถ€๋ถ„

 

(๋†’์ด/๋„“์ด)*100 ===> ํฐ ์ด๋ฏธ์ง€ ๊ธฐ์ค€.

 

 

 

220321 ์ถ”๊ฐ€

 

height / width * 100 = padding-bottom

[CSS] selector { width: 100%; padding-bottom: ๊ณ„์‚ฐ๊ฐ’; background-size: 100%; }

 

์ถœ์ฒ˜ https://5603.tistory.com/135

๋ฐ˜์‘ํ˜•