Bootstrap
Mulailah dengan memasukkan CSS dan JavaScript, Bootstrap siap diproduksi melalui CDN tanpa perlu langkah pembuatan apa pun.
Lets Start
Buat file index.htmlbaru di folder project anda.Masukkan juga <meta name="viewport">
untuk tampilan responsive di perangkat Mobile.
<!doctype html><html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>Bootstrap demo</title> </head> <body> <h1>Hello, world!</h1> </body></html>
Masukkan Bootstrap CSS dan JavaScriot,Letakkan <link>
didalam tag <head>
untuk CSS, dan tag <script>
untuk paket JavaScript (termasuk Popper untuk posisi dropdowns, poppers, dan tooltips) sebelum tag penutup </body>
<!doctype html><html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>Bootstrap demo</title> <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-rbsA2VBKQhggwzxH7pPCaAqO46MgnOM80zW1RWuH61DGLwZJEdK2Kadq2F9CUG65" crossorigin="anonymous"> </head> <body> <h1>Hello, world!</h1> <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/js/bootstrap.bundle.min.js" integrity="sha384-kenU1KFdBIe4zVF0s0G1M5b4hcpxyD9F7jL+jjXkk+Q2h455rYXK/7HAuoJl+0I4" crossorigin="anonymous"></script> </body></html>
Anda juga dapat menyertakan Popper dan JS secara terpisah. Jika Anda tidak berencana untuk menggunakan dropdown, popover, atau tooltips,anda tidak perlu menyertakan Popper.
<script src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.11.6/dist/umd/popper.min.js" integrity="sha384-oBqDVmMz9ATKxIep9tiCxS/Z9fNfEXiDAYTujMAeBAsjFuCZSmKbSSUnQlmh/jp3" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/js/bootstrap.min.js" integrity="sha384-cuYeSxntonz0PPNlHhBs68uyIAVpIIOZZ5JqeqvYYIcEL727kskC66kF92t6Xl2V" crossorigin="anonymous"></script>
Buka project anda menggunakan Live Server untuk melihat hasilnya..