background-size: contain;
: ์ด๋ฏธ์ง๊ฐ ์๋ฆฌ๊ฑฐ๋ ์ฐ๊ทธ๋ฌ์ง์ง ์๋ ํ๋ ๋ด์์ ์ ์ผ ํฌ๊ฒ ์ค์ , ์ฌ๋ฐฑ ๋ฐ์
background-size: cover;
: ์ด๋ฏธ์ง๊ฐ ์ฐ๊ทธ๋ฌ์ง์ง ์๋ ํ๋ ๋ด์์ ์ ์ผ ํฌ๊ฒ ์ค์ + ์ด๋ฏธ์ง์ ๊ฐ๋ก์ธ๋ก๋น ๋ง์ถ๊ธฐ ์ํด ์ด๋ฏธ์ง๋ฅผ ์๋ผ๋ด์ด ์ฌ๋ฐฑ ๋ฐ์X
๋ณดํต ์ด๋ฏธ์ง ๋ฐ์ํ์ผ๋ก ์ง์ด๋ฃ์ ๋
div {
background-image: url("img.png");
background-position: center;
background-size: cover
background-repeat: no-repeat;
}
div {
background: url("img.png") center/cover no-repeat;
}
์์
.box1 {
box-shadow: inset 20px 20px #4a5568;
}
.box2 {
box-shadow: inset 20px -20px #4a5568;
}
.box3 {
box-shadow: inset -20px 20px #4a5568;
}
.box4 {
box-shadow: inset -20px -20px #4a5568;
}
.box {
background-image: url('img.png');
color: transparent;
background-clip: text;
-webkit-background-clip: text;
}
.box{
background-clip : padding-box;
}
.box{
background-clip: content-box;
}
๐ก๋จ์ถ์์ฑ์ ๊ฐ๋ณ์์ฑ ์์ ์ฃผ์ด์ผ ํจ
div { background-clip : padding-box; background: lightgoldenrodyellow; }
์ ์์๋ก ์ฃผ๋ฉด ๋จ์ถ์์ฑ
background
์์ ๊ฐ๋ณ์์ฑbackground-clip
์์ฑ ์ค ๊ฒ์ด ์ฌ๋ผ์ง
์ ์์์ ๋ฐ๋์์๋ก ์์ฑํด์ผ ํจ