]> git.ipfire.org Git - ipfire.org.git/blob - src/scss/bootstrap-4.0.0-alpha.6/docs/getting-started/introduction.md
Introduce autotools
[ipfire.org.git] / src / scss / bootstrap-4.0.0-alpha.6 / docs / getting-started / introduction.md
1 ---
2 layout: docs
3 title: Introduction
4 description: Get started with Bootstrap using the Bootstrap CDN and a template starter page.
5 group: getting-started
6 redirect_from: "/getting-started/"
7 ---
8
9 Bootstrap is the world's most popular framework for building responsive, mobile-first sites and applications. Inside you'll find high quality HTML, CSS, and JavaScript to make starting any project easier than ever.
10
11 Here's how to quickly get started with the Bootstrap CDN and a template starter page.
12
13 ## Contents
14
15 * Will be replaced with the ToC, excluding the "Contents" header
16 {:toc}
17
18 ## Quick start
19
20 Looking to quickly add Bootstrap to your project? Use the Bootstrap CDN, provided for free by the folks at MaxCDN. Using a package manager or need to download the source files? [Head to the downloads page.]({{ site.baseurl }}/getting-started/download/)
21
22 Copy-paste the stylesheet `<link>` into your `<head>` before all other stylesheets to load our CSS.
23
24 {% highlight html %}
25 <link rel="stylesheet" href="{{ site.cdn.css }}" integrity="{{ site.cdn.css_hash }}" crossorigin="anonymous">
26 {% endhighlight %}
27
28 Add our JavaScript plugins, jQuery, and Tether near the end of your pages, right before the closing `</body>` tag. Be sure to place jQuery and Tether first, as our code depends on them. While we use [jQuery's slim build](https://blog.jquery.com/2016/06/09/jquery-3-0-final-released/) in our docs, the full version is also supported.
29
30 {% highlight html %}
31 <script src="{{ site.cdn.jquery }}" integrity="{{ site.cdn.jquery_hash }}" crossorigin="anonymous"></script>
32 <script src="{{ site.cdn.tether }}" integrity="{{ site.cdn.tether_hash }}" crossorigin="anonymous"></script>
33 <script src="{{ site.cdn.js }}" integrity="{{ site.cdn.js_hash }}" crossorigin="anonymous"></script>
34 {% endhighlight %}
35
36 And that's it—you're on your way to a fully Bootstrapped site. If you're at all unsure about the general page structure, keep reading for an example page template.
37
38 ## Starter template
39
40 Be sure to have your pages set up with the latest design and development standards. That means using an HTML5 doctype and including a viewport meta tag for proper responsive behaviors. Put it all together and your pages should look like this:
41
42 {% highlight html %}
43 <!DOCTYPE html>
44 <html lang="en">
45 <head>
46 <!-- Required meta tags -->
47 <meta charset="utf-8">
48 <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
49
50 <!-- Bootstrap CSS -->
51 <link rel="stylesheet" href="{{ site.cdn.css }}" integrity="{{ site.cdn.css_hash }}" crossorigin="anonymous">
52 </head>
53 <body>
54 <h1>Hello, world!</h1>
55
56 <!-- jQuery first, then Tether, then Bootstrap JS. -->
57 <script src="{{ site.cdn.jquery }}" integrity="{{ site.cdn.jquery_hash }}" crossorigin="anonymous"></script>
58 <script src="{{ site.cdn.tether }}" integrity="{{ site.cdn.tether_hash }}" crossorigin="anonymous"></script>
59 <script src="{{ site.cdn.js }}" integrity="{{ site.cdn.js_hash }}" crossorigin="anonymous"></script>
60 </body>
61 </html>
62 {% endhighlight %}
63
64 That's all you need for overall page requirements. Visit the [Layout docs]({{ site.baseurl }}/layout/overview/) or [our official examples]({{ site.baseurl }}/examples/) to start laying out your site's content and components.
65
66 ## Important globals
67
68 Bootstrap employs a handful of important global styles and settings that you'll need to be aware of when using it, all of which are almost exclusively geared towards the *normalization* of cross browser styles. Let's dive in.
69
70 ### HTML5 doctype
71
72 Bootstrap requires the use of the HTML5 doctype. Without it, you'll see some funky incomplete styling, but including it shouldn't cause any considerable hiccups.
73
74 {% highlight html %}
75 <!DOCTYPE html>
76 <html lang="en">
77 ...
78 </html>
79 {% endhighlight %}
80
81 ### Responsive meta tag
82
83 Bootstrap is developed *mobile first*, a strategy in which we optimize code for mobile devices first and then scale up components as necessary using CSS media queries. To ensure proper rendering and touch zooming for all devices, **add the responsive viewport meta tag** to your `<head>`.
84
85 {% highlight html %}
86 <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
87 {% endhighlight %}
88
89 You can see an example of this in action in the [starter template](#starter-template).
90
91 ### Box-sizing
92
93 For more straightforward sizing in CSS, we switch the global `box-sizing` value from `content-box` to `border-box`. This ensures `padding` does not affect the final computed width of an element, but it can cause problems with some third party software like Google Maps and Google Custom Search Engine.
94
95 On the rare occasion you need to override it, use something like the following:
96
97 {% highlight scss %}
98 .selector-for-some-widget {
99 -webkit-box-sizing: content-box;
100 -moz-box-sizing: content-box;
101 box-sizing: content-box;
102 }
103 {% endhighlight %}
104
105 With the above snippet, nested elements—including generated content via `:before` and `:after`—will all inherit the specified `box-sizing` for that `.selector-for-some-widget`.
106
107 Learn more about [box model and sizing at CSS Tricks](https://css-tricks.com/box-sizing/).
108
109 ### Normalize.css
110
111 For improved cross-browser rendering, we use [Normalize.css](https://necolas.github.io/normalize.css/) to correct small inconsistencies across browsers and devices. We further build on this with our own, slightly more opinionated styles with [Reboot]({{ site.baseurl }}/content/reboot/).
112
113 ## Community
114
115 Stay up to date on the development of Bootstrap and reach out to the community with these helpful resources.
116
117 - Follow [@getbootstrap on Twitter](https://twitter.com/getbootstrap).
118 - Read and subscribe to [The Official Bootstrap Blog]({{ site.blog }}).
119 - Join [the official Slack room]({{ site.slack }}).
120 - Chat with fellow Bootstrappers in IRC. On the `irc.freenode.net` server, in the `##bootstrap` channel.
121 - Implementation help may be found at Stack Overflow (tagged [`bootstrap-4`](https://stackoverflow.com/questions/tagged/bootstrap-4)).
122 - Developers should use the keyword `bootstrap` on packages which modify or add to the functionality of Bootstrap when distributing through [npm](https://www.npmjs.com/browse/keyword/bootstrap) or similar delivery mechanisms for maximum discoverability.
123
124 You can also follow [@getbootstrap on Twitter](https://twitter.com/getbootstrap) for the latest gossip and awesome music videos.