https://getbootstrap.com/docs/5.1/layout/grid/
Grid system
Use our powerful mobile-first flexbox grid to build layouts of all shapes and sizes thanks to a twelve column system, six default responsive tiers, Sass variables and mixins, and dozens of predefined classes.
getbootstrap.com
bootstrap์ ์น์ฌ์ดํธ ์ ์ฒด๋ฅผ 12๋ฑ๋ถํจ
์น์ฌ์ดํธ์ ๊ตฌ์ญ์ 12์ ์ฝ์๋ค๋งํผ ๋๋
col-sm-12 ํด๋์ค๋ฅผ ๊ฐ ๋ฐ์ค๋ง๋ค ์ถ๊ฐํด์ค๋ค.
์ด ๋ 12, 3์ ๋น์จ์ ์๋ฏธ
<div>
<div class="row">
<div class="col-lg-3 col-md-6 col-sm-12 box">
<div class="card" style="width: 18rem;">
<img src="https://blog.kakaocdn.net/dna/c9uBIm/btrATdY3TR5/AAAAAAAAAAAAAAAAAAAAAEio1HWgnAWSA8atCO4wZ4Y0c07BiEb8J5GlKoZqPglq/img.gif?credential=yqXZFxpELC7KVnFOS48ylbz2pIh7yKj8&expires=1756652399&allow_ip=&allow_referer=&signature=895P0fah8dYgVHN%2F4CBKRzLS3DM%3D" class="card-img-top" alt="์ง๋">
<div class="card-body">
<h5 class="card-title">์๋ฏน์ค ์ง๋</h5>
<p class="card-text">Some quick example text to build on the card title and make up the bulk of the card's content.</p>
<a href="#" class="btn btn-primary">Go somewhere</a>
</div>
</div>
</div>
<div class="col-lg-3 col-md-6 col-sm-12 box">
<div class="card" style="width: 18rem;">
<img src="https://blog.kakaocdn.net/dna/c9uBIm/btrATdY3TR5/AAAAAAAAAAAAAAAAAAAAAEio1HWgnAWSA8atCO4wZ4Y0c07BiEb8J5GlKoZqPglq/img.gif?credential=yqXZFxpELC7KVnFOS48ylbz2pIh7yKj8&expires=1756652399&allow_ip=&allow_referer=&signature=895P0fah8dYgVHN%2F4CBKRzLS3DM%3D" class="card-img-top" alt="์ง๋">
<div class="card-body">
<h5 class="card-title">์๋ฏน์ค ์ง๋</h5>
<p class="card-text">Some quick example text to build on the card title and make up the bulk of the card's content.</p>
<a href="#" class="btn btn-primary">Go somewhere</a>
</div>
</div>
</div>
<div class="col-lg-3 col-md-6 col-sm-12 box">
<div class="card" style="width: 18rem;">
<img src="https://blog.kakaocdn.net/dna/c9uBIm/btrATdY3TR5/AAAAAAAAAAAAAAAAAAAAAEio1HWgnAWSA8atCO4wZ4Y0c07BiEb8J5GlKoZqPglq/img.gif?credential=yqXZFxpELC7KVnFOS48ylbz2pIh7yKj8&expires=1756652399&allow_ip=&allow_referer=&signature=895P0fah8dYgVHN%2F4CBKRzLS3DM%3D" class="card-img-top" alt="์ง๋">
<div class="card-body">
<h5 class="card-title">์๋ฏน์ค ์ง๋</h5>
<p class="card-text">Some quick example text to build on the card title and make up the bulk of the card's content.</p>
<a href="#" class="btn btn-primary">Go somewhere</a>
</div>
</div>
</div>
<div class="col-lg-3 col-md-6 col-sm-12 box">
<div class="card" style="width: 18rem;">
<img src="https://blog.kakaocdn.net/dna/c9uBIm/btrATdY3TR5/AAAAAAAAAAAAAAAAAAAAAEio1HWgnAWSA8atCO4wZ4Y0c07BiEb8J5GlKoZqPglq/img.gif?credential=yqXZFxpELC7KVnFOS48ylbz2pIh7yKj8&expires=1756652399&allow_ip=&allow_referer=&signature=895P0fah8dYgVHN%2F4CBKRzLS3DM%3D" class="card-img-top" alt="์ง๋">
<div class="card-body">
<h5 class="card-title">์๋ฏน์ค ์ง๋</h5>
<p class="card-text">Some quick example text to build on the card title and make up the bulk of the card's content.</p>
<a href="#" class="btn btn-primary">Go somewhere</a>
</div>
</div>
</div>
</div>
</div>
https://getbootstrap.com/docs/5.1/layout/grid/#grid-options
col-sm-12๋ small์ฌ์ด์ฆ๊ฐ ๋์ ๋ ๊ฐ๊ฐ์ ๋ฐ์ค๊ฐ 12๋ฑ๋ถ๋ ๊ณต๊ฐ ์ค 12๋งํผ ์ฐจ์งํ๋ ๊ฒ (๊ฝ ์ฐจ์ง)
์ด๋ฅผ ์ด๊ณผํ๋ฉด ๋ค์ ์ค๋ก ๋์ด๊ฐ
col-lg-3 : large ์ฌ์ด์ฆ์ผ ๋ ๊ฐ๊ฐ์ ๋ฐ์ค๊ฐ 3/12๋งํผ ์ฐจ์ง
col-md-6 : medium ์ฌ์ด์ฆ์ผ ๋ ๊ฐ๊ฐ์ ๋ฐ์ค๊ฐ 6/12๋งํผ ์ฐจ์ง
https://getbootstrap.com/docs/5.1/layout/containers/
Containers
Containers are a fundamental building block of Bootstrap that contain, pad, and align your content within a given device or viewport.
getbootstrap.com
๊ทธ์น๋ง ์์ ์บก์ณ๋ค์ ์์ box๋ค์ด ๋๋ฌด ํผ์ ธ์๊ณ , ์ด๋ฅผ ํด๊ฒฐํ๊ธฐ ์ํด container ํด๋์ค ์ด์ฉ
<div class="container">
<div class="row">
<div class="col-lg-3 col-md-6 col-sm-12 box">
<div class="card" style="width: 18rem;">
<div class="card-body">
<h5 class="card-title">card</h5>
<p class="card-text">Some quick example text to build on the card title and make up the bulk of the card's content.</p>
<a href="#" class="btn btn-primary">Go somewhere</a>
</div>
</div>
</div>
<div class="col-lg-3 col-md-6 col-sm-12 box">
<div class="card" style="width: 18rem;">
<div class="card-body">
<h5 class="card-title">card</h5>
<p class="card-text">Some quick example text to build on the card title and make up the bulk of the card's content.</p>
<a href="#" class="btn btn-primary">Go somewhere</a>
</div>
</div>
</div>
<div class="col-lg-3 col-md-6 col-sm-12 box">
<div class="card" style="width: 18rem;">
<div class="card-body">
<h5 class="card-title">card</h5>
<p class="card-text">Some quick example text to build on the card title and make up the bulk of the card's content.</p>
<a href="#" class="btn btn-primary">Go somewhere</a>
</div>
</div>
</div>
<div class="col-lg-3 col-md-6 col-sm-12 box">
<div class="card" style="width: 18rem;">
<div class="card-body">
<h5 class="card-title">card</h5>
<p class="card-text">Some quick example text to build on the card title and make up the bulk of the card's content.</p>
<a href="#" class="btn btn-primary">Go somewhere</a>
</div>
</div>
</div>
</div>
</div>
'html, css' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
Flex vs Grid (0) | 2025.03.05 |
---|---|
CSS Grid ์ ๋ฆฌ (0) | 2022.12.08 |
์ฝ๋๋๋ - HTML, CSS / chapter 6 - Spotify ์น์ฌ์ดํธ ๋ง๋ค๊ธฐ (0) | 2022.05.15 |
์ฝ๋๋๋ - HTML, CSS / chapter 5 - HTML์ ์ข ๋ ์ฝ๊ฒ ์์ง์ด๋ ๋ฐฉ๋ฒ (0) | 2022.02.16 |
์ฝ๋๋๋ - HTML, CSS / Chapter 4 - ๊ตฌ๊ธ ์น์ฌ์ดํธ ๋ง๋ค๊ธฐ (0) | 2022.02.07 |