4 description: Documentation and examples for Reboot, Bootstrap's collection of element-specific CSS that builds on Normalize.css.
6 redirect_from: "/content/"
9 Part of Bootstrap's job is to provide an elegant, consistent, and simple baseline to build upon. We use Reboot, a collection of element-specific CSS changes in a single file, to kickstart that.
11 Reboot builds upon Normalize, providing many HTML elements with somewhat opinionated styles using only element selectors. Additional styling is done only with classes. For example, we reboot some `<table>` styles for a simpler baseline and later provide `.table`, `.table-bordered`, and more.
15 * Will be replaced with the ToC, excluding the "Contents" header
20 Here are our guidelines and reasons for choosing what to override in Reboot:
22 - Update some browser default values to use `rem`s instead of `em`s for scalable component spacing.
23 - Avoid `margin-top`. Vertical margins can collapse, yielding unexpected results. More importantly though, a single direction of `margin` is a simpler mental model.
24 - For easier scaling across device sizes, block elements should use `rem`s for `margin`s.
25 - Keep declarations of `font`-related properties to a minimum, using `inherit` whenever possible.
29 The `<html>` and `<body>` elements are updated to provide better page-wide defaults. More specifically:
31 - The `box-sizing` is globally set on every element—including `*:before` and `*:after`, to `border-box`. This ensures that the declared width of element is never exceeded due to padding or border.
32 - A base `font-size: 16px` is declared on the `<html>` and `font-size: 1rem` on the `<body>` for easy responsive type-scaling via media queries.
33 - The `<body>` also sets a global `font-family` and `line-height`. This is inherited later by some form elements to prevent font inconsistencies.
34 - For safety, the `<body>` has a declared `background-color`, defaulting to `#fff`.
38 The default web fonts (Helvetica Neue, Helvetica, and Arial) have been dropped in Bootstrap 4 and replaced with a "native font stack" for optimum text rendering on every device and OS. Read more about [native font stacks in this *Smashing Magazine* article](https://www.smashingmagazine.com/2015/11/using-system-ui-fonts-practical-guide/).
41 $font-family-sans-serif:
42 // Safari for OS X and iOS (San Francisco)
44 // Chrome >= 56 for OS X (San Francisco), Windows, Linux and Android
46 // Chrome < 56 for OS X (San Francisco)
53 "Helvetica Neue", Arial, sans-serif !default;
56 This `font-family` is applied to the `<body>` and automatically inherited globally throughout Bootstrap. To switch the global `font-family`, update `$font-family-base` and recompile Bootstrap.
58 ## Headings and paragraphs
60 All heading elements—e.g., `<h1>`—and `<p>` are reset to have their `margin-top` removed. Headings have `margin-bottom: .5rem` added and paragraphs `margin-bottom: 1rem` for easy spacing.
62 <div class="bd-example">
65 Curabitur blandit tempus porttitor. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum.
68 Curabitur blandit tempus porttitor. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum.
71 Curabitur blandit tempus porttitor. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum.
74 Curabitur blandit tempus porttitor. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum.
77 Curabitur blandit tempus porttitor. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum.
80 Curabitur blandit tempus porttitor. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum.
86 All lists—`<ul>`, `<ol>`, and `<dl>`—have their `margin-top` removed and a `margin-bottom: 1rem`. Nested lists have no `margin-bottom`.
88 <div class="bd-example">
90 * Lorem ipsum dolor sit amet
91 * Consectetur adipiscing elit
92 * Integer molestie lorem at massa
93 * Facilisis in pretium nisl aliquet
94 * Nulla volutpat aliquam velit
95 * Phasellus iaculis neque
96 * Purus sodales ultricies
97 * Vestibulum laoreet porttitor sem
98 * Ac tristique libero volutpat at
99 * Faucibus porta lacus fringilla vel
100 * Aenean sit amet erat nunc
101 * Eget porttitor lorem
103 1. Lorem ipsum dolor sit amet
104 2. Consectetur adipiscing elit
105 3. Integer molestie lorem at massa
106 4. Facilisis in pretium nisl aliquet
107 5. Nulla volutpat aliquam velit
108 6. Faucibus porta lacus fringilla vel
109 7. Aenean sit amet erat nunc
110 8. Eget porttitor lorem
114 For simpler styling, clear hierarchy, and better spacing, description lists have updated `margin`s. `<dd>`s reset `margin-left` to `0` and add `margin-bottom: .5rem`. `<dt>`s are **bolded**.
116 <div class="bd-example">
119 <dt>Description lists</dt>
120 <dd>A description list is perfect for defining terms.</dd>
122 <dd>Vestibulum id ligula porta felis euismod semper eget lacinia odio sem.</dd>
123 <dd>Donec id elit non mi porta gravida at eget metus.</dd>
124 <dt>Malesuada porta</dt>
125 <dd>Etiam porta sem malesuada magna mollis euismod.</dd>
132 The `<pre>` element is reset to remove its `margin-top` and use `rem` units for its `margin-bottom`.
134 <div class="bd-example">
146 Tables are slightly adjusted to style `<caption>`s, collapse borders, and ensure consistent `text-align` throughout. Additional changes for borders, padding, and more come with [the `.table` class]({{ site.baseurl }}/content/tables/).
148 <div class="bd-example">
151 This is an example table, and this is its caption to describe the contents.
155 <th>Table heading</th>
156 <th>Table heading</th>
157 <th>Table heading</th>
158 <th>Table heading</th>
186 Various form elements have been rebooted for simpler base styles. Here are some of the most notable changes:
188 - `<fieldset>`s have no borders, padding, or margin so they can be easily used as wrappers for individual inputs or groups of inputs.
189 - `<legend>`s, like fieldsets, have also been restyled to be displayed as a heading of sorts.
190 - `<label>`s are set to `display: inline-block` to allow `margin` to be applied.
191 - `<input>`s, `<select>`s, `<textarea>`s, and `<button>`s are mostly addressed by Normalize, but Reboot removes their `margin` and sets `line-height: inherit`, too.
192 - `<textarea>`s are modified to only be resizable vertically as horizontal resizing often "breaks" page layout.
194 These changes, and more, are demonstrated below.
196 <form class="bd-example">
198 <legend>Example legend</legend>
201 <label for="input">Example input</label>
202 <input type="text" id="input" placeholder="Example input">
206 <label for="select">Example select</label>
208 <option value="">Choose...</option>
209 <optgroup label="Option group 1">
210 <option value="">Option 1</option>
211 <option value="">Option 2</option>
212 <option value="">Option 3</option>
214 <optgroup label="Option group 2">
215 <option value="">Option 4</option>
216 <option value="">Option 5</option>
217 <option value="">Option 6</option>
224 <input type="checkbox" value="">
231 <input type="radio" name="optionsRadios" id="optionsRadios1" value="option1" checked>
232 Option one is this and that
235 <input type="radio" name="optionsRadios" id="optionsRadios2" value="option2">
236 Option two is something else that's also super long to demonstrate the wrapping of these fancy form controls.
239 <input type="radio" name="optionsRadios" id="optionsRadios3" value="option3" disabled>
240 Option three is disabled
245 <label for="textarea">Example textarea</label>
246 <textarea id="textarea" rows="3"></textarea>
250 <label for="time">Example temporal</label>
251 <input type="datetime-local" id="time">
255 <label for="output">Example output</label>
256 <output name="result" id="output">100</output>
260 <button type="submit">Button submit</button>
261 <input type="submit" value="Input submit button">
262 <input type="button" value="Input button">
266 <button type="submit" disabled>Button submit</button>
267 <input type="submit" value="Input submit button" disabled>
268 <input type="button" value="Input button" disabled>
277 The `<address>` element is updated to reset the browser default `font-style` from `italic` to `normal`. `line-height` is also now inherited, and `margin-bottom: 1rem` has been added. `<address>`s are for presenting contact information for the nearest ancestor (or an entire body of work). Preserve formatting by ending lines with `<br>`.
279 <div class="bd-example">
281 <strong>Twitter, Inc.</strong><br>
282 1355 Market St, Suite 900<br>
283 San Francisco, CA 94103<br>
284 <abbr title="Phone">P:</abbr> (123) 456-7890
288 <strong>Full Name</strong><br>
289 <a href="mailto:#">first.last@example.com</a>
295 The default `margin` on blockquotes is `1em 40px`, so we reset that to `0 0 1rem` for something more consistent with other elements.
297 <div class="bd-example">
298 <blockquote class="blockquote">
299 <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.</p>
300 <footer>Someone famous in <cite title="Source Title">Source Title</cite></footer>
306 The `<abbr>` element receives basic styling to make it stand out amongst paragraph text.
308 <div class="bd-example">
309 Nulla <abbr title="attribute">attr</abbr> vitae elit libero, a pharetra augue.
312 ## HTML5 `[hidden]` attribute
314 HTML5 adds [a new global attribute named `[hidden]`](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/hidden), which is styled as `display: none` by default. Borrowing an idea from [PureCSS](http://purecss.io), we improve upon this default by making `[hidden] { display: none !important; }` to help prevent its `display` from getting accidentally overridden. While `[hidden]` isn't natively supported by IE10, the explicit declaration in our CSS gets around that problem.
317 <input type="text" hidden>
320 {% callout warning %}
321 #### jQuery incompatibility
323 `[hidden]` is not compatible with jQuery's `$(...).hide()` and `$(...).show()` methods. This could potentially change in jQuery 3, but we're not holding our breath. Therefore, we don't currently especially endorse `[hidden]` over other techniques for managing the `display` of elements.
326 To merely toggle the visibility of an element, meaning its `display` is not modified and the element can still affect the flow of the document, use [the `.invisible` class]({{ site.baseurl }}/utilities/invisible-content/) instead.
328 ## Click delay optimization for touch
330 Traditionally, browsers on touchscreen devices have a delay of approximately 300ms between the end of a "tap" – the moment when a finger/stylus is lifted from screen – and the [`click` event](https://developer.mozilla.org/en-US/docs/Web/Events/click) being fired. This delay is necessary for these browsers to correctly handle "double-tap to zoom" gestures without prematurely triggering actions or links after the first "tap", but it can make your site feel slightly sluggish and unresponsive.
332 Most mobile browsers automatically optimize away this 300ms delay for sites that use the `width=device-width` property as part of their [responsive meta tag]({{ site.baseurl }}/getting-started/introduction/#responsive-meta-tag) (as well as for sites that disable zooming, for instance with `user-scalable=no`, though this practice is strongly discouraged for accessibility and usability reasons). The biggest exceptions here are IE11 on Windows Phone 8.1, and iOS Safari (and any other iOS WebView-based browser) [prior to iOS 9.3](https://webkit.org/blog/5610/more-responsive-tapping-on-ios/).
334 On touch-enabled laptop/desktop devices, IE11 and Microsoft Edge are currently the only browsers with "double-tap to zoom" functionality. As the [responsive meta tag]({{ site.baseurl }}/getting-started/introduction/#responsive-meta-tag) is ignored by all desktop browsers, using `width=device-width` will have no effect on the 300ms delay here.
336 To address this problem in IE11 and Microsoft Edge on desktop, as well as IE11 on Windows Phone 8.1, Bootstrap explicitly uses the [`touch-action:manipulation` CSS property](https://developer.mozilla.org/en-US/docs/Web/CSS/touch-action) on all interactive elements (such as buttons and links). This property essentially disables double-tap functionality on those elements, eliminating the 300ms delay.
338 In the case of old iOS versions (prior to 9.3), the suggested approach is to use additional scripts such as [FastClick](https://github.com/ftlabs/fastclick) to explicitly work around the delay.
340 For further details, see the compatibility table for [suppressing 300ms delay for touchscreen interactions](https://patrickhlauke.github.io/touch/tests/results/#suppressing-300ms-delay).