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

html, css

์ฝ”๋ˆ„๋‚˜๋‹˜ - HTML, CSS / Chapter 7 - ๋ฐ˜์‘ํ˜• ์›น์‚ฌ์ดํŠธ ๋งŒ๋“ค๊ธฐ Bootstrap

 

 

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์˜ ์•ฝ์ˆ˜๋“ค๋งŒํผ ๋‚˜๋ˆ”

 

 

 

๋ชจ๋ฐ”์ผ์—์„œ๋Š” ์ด ์นด๋“œ๋“ค์ด ๋‚˜๋ž€ํžˆ ์ •๋ ฌ์ด ์•„๋‹Œ blockํ˜•ํƒœ๋กœ ์ •๋ ฌ์‹œํ‚ค๋Š” ๊ฒŒ ์ข‹์„ํ…๋ฐ, ์ด ๋•Œ์˜ ํ•ด๊ฒฐ๋ฐฉ์•ˆ์€?

 

 

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๋งŒํผ ์ฐจ์ง€

 

 

large - medium - small

 

 

 

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>

 

 

1398px, 1400px ์ด์ƒ, 1400px ๋„˜์–ด๊ฐ€๋ฉด ๋ฐ•์Šค๋“ค(์—ฌ๋ฐฑํฌํ•จ)์˜ ๋„ˆ๋น„๊ฐ€ 1320px๊ฐ€ ๋  ๋•Œ๊นŒ์ง€ ์—ฌ๋ฐฑ์ด ๋Š˜์–ด๋‚˜์ง€๋งŒ ์ด๋Š” max-width๋ฅผ ํ•ด์ œํ•ด์ฃผ๋ฉด ๋จ