getting-started.html 13.4 KB
Newer Older
Mark Otto's avatar
Mark Otto committed
1
2
---
layout: default
3
title: Getting started
4
description: Overview of the project, its contents, and how to get started with a simple template.
Mark Otto's avatar
Mark Otto committed
5
6
7
8
9
10
11
12
13
14
15
16
---

<!-- Subhead
================================================== -->
<header class="bs-docs-jumbotron subhead">
  <div class="container">
    <h1>Getting started</h1>
    <p class="lead">Overview of the project, its contents, and how to get started with a simple template.</p>
  </div>
</header>


17
18
19
20
21
<div class="container">

  <!-- Docs nav
  ================================================== -->
  <div class="row">
Mark Otto's avatar
Mark Otto committed
22
    <div class="col-span-3 bs-docs-sidebar">
23
      <ul class="nav nav-list bs-docs-sidenav">
24
25
26
27
28
29
        <li><a href="#download-bootstrap"><i class="glyphicon glyphicon-chevron-right"></i> Download</a></li>
        <li><a href="#file-structure"><i class="glyphicon glyphicon-chevron-right"></i> File structure</a></li>
        <li><a href="#contents"><i class="glyphicon glyphicon-chevron-right"></i> What's included</a></li>
        <li><a href="#html-template"><i class="glyphicon glyphicon-chevron-right"></i> HTML template</a></li>
        <li><a href="#examples"><i class="glyphicon glyphicon-chevron-right"></i> Examples</a></li>
        <li><a href="#what-next"><i class="glyphicon glyphicon-chevron-right"></i> What next?</a></li>
30
31
      </ul>
    </div>
Mark Otto's avatar
Mark Otto committed
32
    <div class="col-span-9">
33
34
35
36
37
38
39
40
41
42
43
44
45



      <!-- Download
      ================================================== -->
      <section id="download-bootstrap">
        <div class="page-header">
          <h1>1. Download</h1>
        </div>
        <p class="lead">Before downloading, be sure to have a code editor (we recommend <a href="http://sublimetext.com/2">Sublime Text 2</a>) and some working knowledge of HTML and CSS. We won't walk through the source files here, but they are available for download. We'll focus on getting started with the compiled Bootstrap files.</p>

        <div class="row">
          <div class="span6">
Mark Otto's avatar
Mark Otto committed
46
            <h2>Compiled</h2>
47
48
            <p><strong>Fastest way to get started:</strong> get the compiled and minified versions of our CSS, JS, and images. No docs or original source files.</p>
            <p><a class="btn btn-large btn-primary" href="assets/bootstrap.zip" onclick="_gaq.push(['_trackEvent', 'Getting started', 'Download', 'Download compiled']);">Download Bootstrap</a></p>
Mark Otto's avatar
Mark Otto committed
49
          </div>
50
          <div class="span6">
Mark Otto's avatar
Mark Otto committed
51
            <h2>Source</h2>
52
53
            <p>Get the original files for all CSS and JavaScript, along with a local copy of the docs by downloading the latest version directly from GitHub.</p>
            <p><a class="btn btn-large" href="https://github.com/twitter/bootstrap/zipball/master" onclick="_gaq.push(['_trackEvent', 'Getting started', 'Download', 'Download source']);">Download Bootstrap source</a></p>
Mark Otto's avatar
Mark Otto committed
54
          </div>
55
          <div class="span6">
Mark Otto's avatar
Mark Otto committed
56
57
58
            <h2>Bower</h2>
            <p>Install and manage the original files for all CSS and JavaScript, along with a local copy of the docs, using <a href="http://twitter.github.com/bower">Bower</a>.</p>
            {% highlight bash %}bower install bootstrap{% endhighlight %}
59
          </div>
60
61
        </div>
      </section>
Mark Otto's avatar
Mark Otto committed
62
63
64



65
66
67
68
69
70
71
72
73
74
      <!-- File structure
      ================================================== -->
      <section id="file-structure">
        <div class="page-header">
          <h1>2. File structure</h1>
        </div>
        <p class="lead">Within the download you'll find the following file structure and contents, logically grouping common assets and providing both compiled and minified variations.</p>
        <p>Once downloaded, unzip the compressed folder to see the structure of (the compiled) Bootstrap. You'll see something like this:</p>

{% highlight bash %}
Mark Otto's avatar
Mark Otto committed
75
76
77
78
79
80
81
82
83
84
85
86
87
  bootstrap/
  ├── css/
  │   ├── bootstrap.css
  │   ├── bootstrap.min.css
  ├── js/
  │   ├── bootstrap.js
  │   ├── bootstrap.min.js
  └── fonts/
      ├── glyphiconshalflings-regular.eot
      ├── glyphiconshalflings-regular.otf
      ├── glyphiconshalflings-regular.svg
      ├── glyphiconshalflings-regular.ttf
      └── glyphiconshalflings-regular.woff
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
{% endhighlight %}

        <p>This is the most basic form of Bootstrap: compiled files for quick drop-in usage in nearly any web project. We provide compiled CSS and JS (<code>bootstrap.*</code>), as well as compiled and minified CSS and JS (<code>bootstrap.min.*</code>). The image files are compressed using <a href="http://imageoptim.com/">ImageOptim</a>, a Mac app for compressing PNGs.</p>
        <p>Please note that <strong>all JavaScript plugins require jQuery</strong> to be included.</p>
      </section>



      <!-- Contents
      ================================================== -->
      <section id="contents">
        <div class="page-header">
          <h1>3. What's included</h1>
        </div>
        <p class="lead">Bootstrap comes equipped with HTML, CSS, and JS for all sorts of things, but they can be summarized with a handful of categories visible at the top of the <a href="http://getbootstrap.com">Bootstrap documentation</a>.</p>

        <h2>Docs sections</h2>
        <p>In addition to the getting started documentation you're reading now, the Bootstrap docs are broken into a few key pages.</p>

        <h4><a href="http://twitter.github.com/bootstrap/css.html">Core CSS</a></h4>
        <p>Global styles for the body, Normalize, links, grid system, tables, forms, buttons, icons, and more.</p>
        <h4><a href="http://twitter.github.com/bootstrap/components.html">Components</a></h4>
        <p>Basic styles for common interface components like tabs and pills, navbar, alerts, page headers, and more. Head here to see what kind of custom components Bootstrap has to offer beyond basic HTML elements.</p>
        <h4><a href="http://twitter.github.com/bootstrap/javascript.html">JavaScript plugins</a></h4>
        <p>Similar to Components, these JavaScript plugins are interactive components for things like tooltips, popovers, modals, and more.</p>
      </section>



      <!-- HTML template
      ================================================== -->
      <section id="html-template">
        <div class="page-header">
          <h1>4. Basic HTML template</h1>
        </div>
        <p class="lead">With a brief intro into the contents out of the way, we can focus on putting Bootstrap to use. To do that, we'll utilize a basic HTML template that includes everything we mentioned in the <a href="./getting-started.html#file-structure">File structure</a>.</p>
        <p>Now, here's a look at a <strong>typical HTML file</strong>:</p>

{% highlight html linenos %}
<!DOCTYPE html>
<html>
  <head>
    <title>Bootstrap 101 Template</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
  </head>
  <body>
    <h1>Hello, world!</h1>
    <script src="http://code.jquery.com/jquery.js"></script>
  </body>
</html>
{% endhighlight %}

        <p>To make this <strong>a Bootstrapped template</strong>, just include the appropriate CSS and JS files:</p>

{% highlight html linenos %}
<!DOCTYPE html>
<html>
  <head>
    <title>Bootstrap 101 Template</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <!-- Bootstrap -->
    <link href="css/bootstrap.min.css" rel="stylesheet" media="screen">
  </head>
  <body>
    <h1>Hello, world!</h1>
    <script src="http://code.jquery.com/jquery.js"></script>
    <script src="js/bootstrap.min.js"></script>
  </body>
</html>
{% endhighlight %}

        <p><strong>And you're set!</strong> With those two files added, you can begin to develop any site or application with Bootstrap.</p>

        <hr>

        <h4>Responsive features in IE8</h4>
        <p>Internet Explorer 8 lacks support for media queries, the method by which we deliver responsive CSS to folks. To enable that, you need to include a third party tool (which we include in the project repository) called <a href="https://github.com/scottjehl/Respond">Respond.js</a>.</p>
Mark Otto's avatar
Mark Otto committed
165
166
167
168
169
<pre class="prettyprint linenums">
&lt;!--[if lt IE 9]&gt;
  &lt;script src="/assets/js/respond/respond.js"&gt;&lt;/script&gt;
&lt;![endif]--&gt;
</pre>
170
171
172
173
174
175
176
177
178
179
180
181
182
      </section>



      <!-- Examples
      ================================================== -->
      <section id="examples">
        <div class="page-header">
          <h1>5. Examples</h1>
        </div>
        <p class="lead">Move beyond the base template with a few example layouts. We encourage folks to iterate on these examples and not simply use them as an end result.</p>
        <div class="row bs-docs-examples">
          <div class="span4">
183
            <a class="thumbnail" href="/examples/starter-template/" target="_blank">
184
185
186
187
              <img src="/assets/img/examples/bootstrap-example-starter.png" alt="">
            </a>
            <h4>Starter template</h4>
            <p>A barebones HTML document with all the Bootstrap CSS and JavaScript included.</p>
Mark Otto's avatar
Mark Otto committed
188
          </div>
189
          <div class="span4">
190
            <a class="thumbnail" href="/examples/jumbotron/" target="_blank">
191
192
193
194
              <img src="/assets/img/examples/bootstrap-example-marketing.png" alt="">
            </a>
            <h4>Basic marketing site</h4>
            <p>Featuring a hero unit for a primary message and three supporting elements.</p>
Mark Otto's avatar
Mark Otto committed
195
          </div>
196
          <div class="span4">
197
            <a class="thumbnail" href="/examples/jumbotron-narrow/" target="_blank">
198
199
200
201
202
203
              <img src="/assets/img/examples/bootstrap-example-jumbotron-narrow.png" alt="">
            </a>
            <h4>Narrow marketing</h4>
            <p>Slim, lightweight marketing template for small projects or teams.</p>
          </div>
          <div class="span4">
204
            <a class="thumbnail" href="/examples/justified-nav/" target="_blank">
205
206
207
208
209
210
              <img src="/assets/img/examples/bootstrap-example-justified-nav.png" alt="">
            </a>
            <h4>Justified nav</h4>
            <p>Marketing page with equal-width navigation links in a modified navbar.</p>
          </div>
          <div class="span4">
211
            <a class="thumbnail" href="/examples/signin/" target="_blank">
212
213
214
215
216
217
              <img src="/assets/img/examples/bootstrap-example-signin.png" alt="">
            </a>
            <h4>Sign in</h4>
            <p>Barebones sign in form with custom, larger form controls and a flexible layout.</p>
          </div>
          <div class="span4">
218
            <a class="thumbnail" href="/examples/sticky-footer/" target="_blank">
219
220
221
222
223
224
              <img src="/assets/img/examples/bootstrap-example-sticky-footer.png" alt="">
            </a>
            <h4>Sticky footer</h4>
            <p>Pin a fixed-height footer to the bottom of the user's viewport.</p>
          </div>
          <div class="span4">
225
            <a class="thumbnail" href="/examples/sticky-footer-navbar/" target="_blank">
226
              <img src="/assets/img/examples/bootstrap-example-sticky-footer-navbar.png" alt="">
227
228
229
230
231
            </a>
            <h4>Sticky footer w/ navbar</h4>
            <p>Add a fixed navbar to the default sticky footer template.</p>
          </div>
          <div class="span4">
232
            <a class="thumbnail" href="/examples/carousel/" target="_blank">
233
234
235
236
237
              <img src="/assets/img/examples/bootstrap-example-carousel.png" alt="">
            </a>
            <h4>Carousel jumbotron</h4>
            <p>An interactive riff on the basic marketing site featuring a prominent carousel.</p>
          </div>
238
239
240


          <div class="span4">
241
242
            <a class="thumbnail" href="/examples/navbar/" target="_blank">
              <img src="/assets/img/examples/bootstrap-example-navbar.png" alt="">
243
244
            </a>
            <h4>Navbar</h4>
245
            <p>Basic template for showcasing how the navbar works.</p>
246
247
          </div>
          <div class="span4">
248
249
            <a class="thumbnail" href="/examples/navbar-static-top/" target="_blank">
              <img src="/assets/img/examples/bootstrap-example-navbar-static-top.png" alt="">
250
251
            </a>
            <h4>Static top navbar</h4>
252
            <p>Basic template for showcasing the static navbar variation.</p>
253
254
          </div>
          <div class="span4">
255
256
            <a class="thumbnail" href="/examples/navbar-fixed-top/" target="_blank">
              <img src="/assets/img/examples/bootstrap-example-navbar-fixed-top.png" alt="">
257
258
            </a>
            <h4>Fixed top navbar</h4>
259
            <p>Basic template for showcasing the fixed navbar variation.</p>
260
          </div>
261
          <div class="span4">
262
            <a class="thumbnail" href="/examples/grid/" target="_blank">
263
264
265
266
267
              <img src="/assets/img/examples/bootstrap-example-.png" alt="">
            </a>
            <h4>Grid examples</h4>
            <p></p>
          </div>
268
269
        </div>
      </section>
Mark Otto's avatar
Mark Otto committed
270
271
272
273




274
275
276
277
278
279
280
281
282
283
      <!-- Next
      ================================================== -->
      <section id="what-next">
        <div class="page-header">
          <h1>What next?</h1>
        </div>
        <p class="lead">Head to the docs for information, examples, and code snippets, or take the next leap and customize Bootstrap for any upcoming project.</p>
        <a class="btn btn-large btn-primary" href="./css.html" onclick="_gaq.push(['_trackEvent', 'Getting started', 'Next steps', 'Visit docs']);">Visit the Bootstrap docs</a>
        <a class="btn btn-large" href="./customize.html" style="margin-left: 5px;" onclick="_gaq.push(['_trackEvent', 'Getting started', 'Next steps', 'Customize']);">Customize Bootstrap</a>
      </section>
Mark Otto's avatar
Mark Otto committed
284
285
286
287




288
289
    </div><!-- /span9 -->
  </div><!-- row -->
Mark Otto's avatar
Mark Otto committed
290

291
</div><!-- /.container -->