๊ฐ์์ ํ์๋ฅผ ์ฌ์ฉํด ์ํ๋ ๋์ด์ ๋์ด๋ฅผ calc
๋ก ๋ง๋ค์ด๋ณด์.
์ฐธ๊ณ ํ ํํ์ด์ง ์ผ์ฑ๋ฐ๋์ฒด
<section>section</section>
<div class="wrap">
<div class="inner">
<ul>
<li>box</li>
<li>box</li>
<li>box</li>
<li>box</li>
</ul>
</div>
</div>
<section>section</section>
/******* reset CSS *******/
* { margin: 0; padding: 0; box-sizing: border-box; }
li { list-style: none; }
/******* custom CSS *******/
section { width: 100%; height: 150px; background: #e9e9e9; }
.wrap { position: relative; padding: 50px 0; }
/* wrap::before๋ฅผ ์ด์ฉํ์ฌ background-color๋ฅผ ๋ง๋ค์ด์ค๋ค. */
.wrap::before {
display: block;
content: 'beforeBG';
width: 100%;
height: calc(100% - 150px);
position: absolute;
bottom: 0;
left: 0;
z-index: -1;
}
.inner { position: relative; max-width: 800px; margin: auto; }
.inner ul::after { display: block; content: ''; clear: both; }
.inner ul li:not(:first-of-type) { float: left; width: 32%; margin-left: 2%; height: 200px; background: yellowgreen; }
.inner ul li:nth-of-type(2) { margin-left: 0; }
.inner ul li:first-of-type { width: 80%; height: 200px; margin: 0 auto 20px; background: gold; }
![](https://blog.kakaocdn.net/dn/bzjWXV/btra6HKr2Sv/JCAkqoJSDZp2zA5wnYg5H0/img.png)
ํ๋์(bottom: 0
)์ ๊ธฐ์ค์ผ๋ก ์์์ 150px ๋จ์ด์ง ๊ณณ์ before
์ด ์ ์ฉ๋๋ค.