Bootstrap ์์ํ๊ธฐ
โข
CDN ์ผ๋ก ์ ์ฉํ๊ธฐ
โข
ํ์ผ๋ก ์ ์ฉํ๊ธฐ
CDN ์ผ๋ก ์ ์ฉํ๊ธฐ
โข
CSS ํฌํจํ๊ธฐ
โข
JS ํฌํจํ๊ธฐ
CSS ํฌํจํ๊ธฐ
head ํ๊ทธ ์์ bootstrap css ํ์ผ์ CDN ๋ฐฉ์์ผ๋ก ํฌํจํฉ๋๋ค.
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/css/bootstrap.min.css" rel="stylesheet">
HTML
๋ณต์ฌ
JS ํฌํจํ๊ธฐ
์ผ๋ฐ์ ์ผ๋ก, body ํ๊ทธ ๋ด๋ถ์ ๋งจ ๋ง์ง๋ง์ JS ํ์ผ์ CDN ๋ฐฉ์์ผ๋ก ํฌํจํฉ๋๋ค.
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/js/bootstrap.bundle.min.js"></script>
HTML
๋ณต์ฌ
์ํ ์ค๋น ์ฝ๋
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>๋ถํธ์คํธ๋ฉ ์์ํ๊ธฐ</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/css/bootstrap.min.css" rel="stylesheet">
</head>
<body>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/js/bootstrap.bundle.min.js"></script>
</body>
</html>
HTML
๋ณต์ฌ
ํ์ผ๋ก ์ ์ฉํ๊ธฐ
bootstrap ๋ผ์ด๋ธ๋ฌ๋ฆฌ ํ์ผ์ ๋ค์ด๋ก๋ ๋ฐ์ ํ๋ก์ ํธ ๋ด๋ถ์ ์ ์ฅํ๊ณ CSS ๋ฐ JS ๋ผ์ด๋ธ๋ฌ๋ฆฌ ํ์ผ์ ํฌํจํฉ๋๋ค.
1.
๋ค์ด๋ก๋
2.
ํ๋ก์ ํธ์ ํ์ผ ์ ์ฅํ๊ธฐ
3.
link, script ํ๊ทธ๋ก ํ์ผ ๋ถ๋ฌ์ค๊ธฐ
๋ค์ด๋ก๋
ํ๋ก์ ํธ์ ํ์ผ ์ ์ฅํ๊ธฐ
๐ฆ Project
โฃ ๐ static
โ โฃ ๐ css
โ โ โ ๐ bootstrap.min.css
โ โ ๐ js
โ โ ๐ bootstrap.bundle.min.js
HTML
๋ณต์ฌ
link, script ํ๊ทธ๋ก ํ์ผ ๋ถ๋ฌ์ค๊ธฐ
<link href="/static/css/bootstrap.min.css" rel="stylesheet">
HTML
๋ณต์ฌ
<script src="/static/js/bootstrap.bundle.min.js"></script>
HTML
๋ณต์ฌ
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>๋ถํธ์คํธ๋ฉ ์์ํ๊ธฐ</title>
<!-- ๋ถํธ์คํธ๋ฉ CSS ํ์ผ -->
<link href="static/css/bootstrap.min.css" rel="stylesheet">
</head>
<body>
<!-- ์ฌ๊ธฐ์ ๋ด์ฉ ์ถ๊ฐ -->
<!-- ๋ถํธ์คํธ๋ฉ JavaScript ํ์ผ -->
<script src="static/js/bootstrap.min.js"></script>
</body>
</html>
HTML
๋ณต์ฌ
์ํ ํ์ด์ง
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>๋ถํธ์คํธ๋ฉ ์ํ ํ์ด์ง</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/css/bootstrap.min.css" rel="stylesheet">
</head>
<body>
<!-- ํค๋ ์น์
-->
<div class="container">
<header class="d-flex flex-wrap justify-content-center py-3 mb-4 border-bottom">
<a href="/" class="d-flex align-items-center mb-3 mb-md-0 me-md-auto text-dark text-decoration-none">
<svg class="bi me-2" width="40" height="32"><use xlink:href="#bootstrap"></use></svg>
<span class="fs-4">ALOHA CLASS</span>
</a>
<ul class="nav nav-pills">
<li class="nav-item"><a href="#" class="nav-link active" aria-current="page">Home</a></li>
<li class="nav-item"><a href="#" class="nav-link">Features</a></li>
<li class="nav-item"><a href="#" class="nav-link">Pricing</a></li>
<li class="nav-item"><a href="#" class="nav-link">FAQs</a></li>
<li class="nav-item"><a href="#" class="nav-link">About</a></li>
</ul>
</header>
</div>
<!-- Heroes ์น์
-->
<section class="bg-light py-5">
<div class="px-4 py-5 my-5 text-center">
<img class="d-block mx-auto mb-4" src="https://placehold.co/100x100" alt="" width="100" height="100">
<h1 class="display-5 fw-bold">ALOHA CLASS</h1>
<div class="col-lg-6 mx-auto">
<p class="lead mb-4">Quickly design and customize responsive mobile-first sites with Bootstrap, the worldโs most popular front-end open source toolkit, featuring Sass variables and mixins, responsive grid system, extensive prebuilt components, and powerful JavaScript plugins.</p>
<div class="d-grid gap-2 d-sm-flex justify-content-sm-center">
<button type="button" class="btn btn-primary btn-lg px-4 gap-3">Primary button</button>
<button type="button" class="btn btn-outline-secondary btn-lg px-4">Secondary</button>
</div>
</div>
</div>
</section>
<!-- Card View ์น์
-->
<section class="py-5">
<div class="container">
<div class="row">
<div class="col-md-4">
<div class="card mb-4">
<img src="https://placehold.co/300x300" class="card-img-top" alt="...">
<div class="card-body">
<h5 class="card-title">์นด๋ ์ ๋ชฉ</h5>
<p class="card-text">์นด๋ ๋ด์ฉ Lorem ipsum dolor sit amet consectetur adipisicing elit. Alias, totam.</p>
<a href="#" class="btn btn-primary">์์ธํ ๋ณด๊ธฐ</a>
</div>
</div>
</div>
<div class="col-md-4">
<div class="card mb-4">
<img src="https://placehold.co/300x300" class="card-img-top" alt="...">
<div class="card-body">
<h5 class="card-title">์นด๋ ์ ๋ชฉ</h5>
<p class="card-text">์นด๋ ๋ด์ฉ Lorem ipsum dolor sit amet consectetur adipisicing elit. Alias, totam.</p>
<a href="#" class="btn btn-primary">์์ธํ ๋ณด๊ธฐ</a>
</div>
</div>
</div>
<div class="col-md-4">
<div class="card mb-4">
<img src="https://placehold.co/300x300" class="card-img-top" alt="...">
<div class="card-body">
<h5 class="card-title">์นด๋ ์ ๋ชฉ</h5>
<p class="card-text">์นด๋ ๋ด์ฉ Lorem ipsum dolor sit amet consectetur adipisicing elit. Alias, totam.</p>
<a href="#" class="btn btn-primary">์์ธํ ๋ณด๊ธฐ</a>
</div>
</div>
</div>
</div>
</div>
</section>
<!-- Footer ์น์
-->
<footer class="bg-dark py-3">
<div class="container">
<div class="text-center text-light">
© 2024 ALOHA CLASS
</div>
</div>
</footer>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/js/bootstrap.bundle.min.js"></script>
</body>
</html>
HTML
๋ณต์ฌ