Bootstrap adalah rangka kerja HTML, CSS, dan JS yang paling popular untuk membangunkan responsif, projek pertama mudah alih di web.
Bootstrap v3.3.7
Objektif adalah memberi panduan kepada para pembangun laman web yang ingin:
Untuk mengikuti panduan ini. Anda perlu mempunyai asas dan pengalaman dalam pembangunan web seperti :
http://amin007.github.io/phparastinggi/nota-bootstrap.html
Mulakan dengan template asas HTML, atau mengubah suai contoh-contoh berikut.
Kami berharap anda akan menyesuaikan template dan contoh kami, menyesuaikan ia untuk memenuhi keperluan anda.
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Bootstrap 101 Template</title>
<!-- Bootstrap -->
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
</head><body>
<h1>Hello, world!</h1>
<!-- jquery and js -->
<script src="https://code.jquery.com/jquery-1.12.4.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
</body></html>
<!DOCTYPE html> <!-- cerulean dari bootswatch.com -->
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Bootswatch Template</title>
<link href="https://maxcdn.bootstrapcdn.com/bootswatch/3.3.7/cerulean/bootstrap.min.css" rel="stylesheet">
</head><body>
<p class="label label-default">Default</p><p class="label label-primary">Primary</p>
<p class="label label-success">Success</p><p class="label label-info">Info</p>
<p class="label label-warning">Warning</p><p class="label label-danger">Danger</p>
</body></html>
<!DOCTYPE html> <!--cosmo dari bootswatch.com -->
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Bootswatch Template</title>
<link href="https://maxcdn.bootstrapcdn.com/bootswatch/3.3.7/cosmo/bootstrap.min.css" rel="stylesheet">
</head><body>
<p class="label label-default">Default</p><p class="label label-primary">Primary</p>
<p class="label label-success">Success</p><p class="label label-info">Info</p>
<p class="label label-warning">Warning</p><p class="label label-danger">Danger</p>
</body></html>
<!DOCTYPE html> <!-- cyborg dari bootswatch.com -->
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Bootswatch Template</title>
<link href="https://maxcdn.bootstrapcdn.com/bootswatch/3.3.7/cyborg/bootstrap.min.css" rel="stylesheet">
</head><body>
<p class="label label-default">Default</p><p class="label label-primary">Primary</p>
<p class="label label-success">Success</p><p class="label label-info">Info</p>
<p class="label label-warning">Warning</p><p class="label label-danger">Danger</p>
</body></html>
<!DOCTYPE html> <!-- darkly dari bootswatch.com -->
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Bootswatch Template</title>
<link href="https://maxcdn.bootstrapcdn.com/bootswatch/3.3.7/darkly/bootstrap.min.css" rel="stylesheet">
</head><body>
<p class="label label-default">Default</p><p class="label label-primary">Primary</p>
<p class="label label-success">Success</p><p class="label label-info">Info</p>
<p class="label label-warning">Warning</p><p class="label label-danger">Danger</p>
</body></html>
<!DOCTYPE html> <!-- flatly dari bootswatch.com -->
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Bootswatch Template</title>
<link href="https://maxcdn.bootstrapcdn.com/bootswatch/3.3.7/flatly/bootstrap.min.css" rel="stylesheet">
</head><body>
<p class="label label-default">Default</p><p class="label label-primary">Primary</p>
<p class="label label-success">Success</p><p class="label label-info">Info</p>
<p class="label label-warning">Warning</p><p class="label label-danger">Danger</p>
</body></html>
<!DOCTYPE html> <!-- journal dari bootswatch.com -->
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Bootswatch Template</title>
<link href="https://maxcdn.bootstrapcdn.com/bootswatch/3.3.7/journal/bootstrap.min.css" rel="stylesheet">
</head><body>
<p class="label label-default">Default</p><p class="label label-primary">Primary</p>
<p class="label label-success">Success</p><p class="label label-info">Info</p>
<p class="label label-warning">Warning</p><p class="label label-danger">Danger</p>
</body></html>
- | Grid system | Typography | Code |
Tables | Forms | Buttons | Images |
Helper classes | Responsive utilities | Using Less | Using Sass |
<div class="container">
...
</div>
<div class="container-fluid">
...
</div>
Pilihan atau alternatif kepada jadual.
Ia digunakan untuk mewujudkan susun atur halaman melalui satu siri baris dan lajur yang menempatkan kandungan tertentu.
Standard Sistem Grid Bootstrap adalah 1-12 jalur bergantung kepada saiz peranti atau viewport.
Ia juga adalah sistem grid cecair responsif mudah alih.
Ia termasuk kelas yang telah ditetapkan untuk pilihan susun atur mudah, serta mixins kuat untuk menjana susun atur lebih semantik.
Meletakkan tiang grid dalam mana-mana .row.
Menggunakan satu set .col-md- * kelas grid
<div class="row">
<div class="col-md-1">.col-md-1</div>
<div class="col-md-1">.col-md-1</div>
<div class="col-md-1">.col-md-1</div>
<div class="col-md-1">.col-md-1</div>
<div class="col-md-1">.col-md-1</div>
<div class="col-md-1">.col-md-1</div>
<div class="col-md-1">.col-md-1</div>
<div class="col-md-1">.col-md-1</div>
</div>
<div class="row">
<div class="col-md-8">.col-md-8</div>
</div>
<div class="row">
<div class="col-md-4">.col-md-4</div>
<div class="col-md-4">.col-md-4</div>
<div class="col-md-4">.col-md-4</div>
<div class="col-md-4">.col-md-4</div>
</div>
<div class="row">
<div class="col-md-6">.col-md-6</div>
<div class="col-md-6">.col-md-6</div>
</div>
Berikut adalah cara sistem grid Bootstrap berfungsi:
Glyphicons | Dropdowns | Button groups | Button dropdowns |
Input groups | Navs | Navbar | Breadcrumbs |
Pagination | Labels | Badges | Jumbotron |
Page header | Thumbnails | Alerts | Progress bars |
Media object | List group | Panels | Responsive embed |
Wells | - | - | - |
Transitions | Modal | Dropdown | Scrollspy |
Tab | Tooltip | Popover | Alert |
Button | Collapse | Carousel | Affix |