position: relative;
padding: 1rem;
margin: 1rem (-$grid-gutter-width / 2);
- overflow: auto;
border: solid #f7f7f9;
border-width: .2rem 0 0;
@include clearfix();
{% example html %}
<div class="btn-group btn-group-toggle" data-toggle="buttons">
<label class="btn btn-secondary active">
- <input type="checkbox" checked autocomplete="off"> Checkbox 1 (pre-checked)
+ <input type="checkbox" checked autocomplete="off"> Active
</label>
<label class="btn btn-secondary">
- <input type="checkbox" autocomplete="off"> Checkbox 2
+ <input type="checkbox" autocomplete="off"> Check
</label>
<label class="btn btn-secondary">
- <input type="checkbox" autocomplete="off"> Checkbox 3
+ <input type="checkbox" autocomplete="off"> Check
</label>
</div>
{% endexample %}
{% example html %}
-<div class="btn-group" data-toggle="buttons">
+<div class="btn-group btn-group-toggle" data-toggle="buttons">
<label class="btn btn-secondary active">
- <input type="radio" name="options" id="option1" autocomplete="off" checked> Radio 1 (preselected)
+ <input type="radio" name="options" id="option1" autocomplete="off" checked> Active
</label>
<label class="btn btn-secondary">
- <input type="radio" name="options" id="option2" autocomplete="off"> Radio 2
+ <input type="radio" name="options" id="option2" autocomplete="off"> Radio
</label>
<label class="btn btn-secondary">
- <input type="radio" name="options" id="option3" autocomplete="off"> Radio 3
+ <input type="radio" name="options" id="option3" autocomplete="off"> Radio
</label>
</div>
{% endexample %}
Below is an example of a basic card with mixed content and a fixed width. Cards have no fixed width to start, so they'll naturally fill the full width of its parent element. This is easily customized with our various [sizing options](#sizing).
{% example html %}
-<div class="card" style="width: 20rem;">
+<div class="card" style="width: 18rem;">
<img class="card-img-top" data-src="holder.js/100px180/" alt="Card image cap">
<div class="card-body">
<h4 class="card-title">Card title</h4>
Subtitles are used by adding a `.card-subtitle` to a `<h*>` tag. If the `.card-title` and the `.card-subtitle` items are placed in a `.card-body` item, the card title and subtitle are aligned nicely.
{% example html %}
-<div class="card" style="width: 20rem;">
+<div class="card" style="width: 18rem;">
<div class="card-body">
<h4 class="card-title">Card title</h4>
<h6 class="card-subtitle mb-2 text-muted">Card subtitle</h6>
`.card-img-top` places an image to the top of the card. With `.card-text`, text can be added to the card. Text within `.card-text` can also be styled with the standard HTML tags.
{% example html %}
-<div class="card" style="width: 20rem;">
+<div class="card" style="width: 18rem;">
<img class="card-img-top" data-src="holder.js/100px180/?text=Image cap" alt="Card image cap">
<div class="card-body">
<p class="card-text">Some quick example text to build on the card title and make up the bulk of the card's content.</p>
Create lists of content in a card with a flush list group.
{% example html %}
-<div class="card" style="width: 20rem;">
+<div class="card" style="width: 18rem;">
<ul class="list-group list-group-flush">
<li class="list-group-item">Cras justo odio</li>
<li class="list-group-item">Dapibus ac facilisis in</li>
{% endexample %}
{% example html %}
-<div class="card" style="width: 20rem;">
+<div class="card" style="width: 18rem;">
<div class="card-header">
Featured
</div>
Mix and match multiple content types to create the card you need, or throw everything in there. Shown below are image styles, blocks, text styles, and a list group—all wrapped in a fixed-width card.
{% example html %}
-<div class="card" style="width: 20rem;">
+<div class="card" style="width: 18rem;">
<img class="card-img-top" data-src="holder.js/100px180/?text=Image cap" alt="Card image cap">
<div class="card-body">
<h4 class="card-title">Card title</h4>
Use custom CSS in your stylesheets or as inline styles to set a width.
{% example html %}
-<div class="card" style="width: 20rem;">
+<div class="card" style="width: 18rem;">
<div class="card-body">
<h4 class="card-title">Special title treatment</h4>
<p class="card-text">With supporting text below as a natural lead-in to additional content.</p>
You can quickly change the text alignment of any card—in its entirety or specific parts—with our [text align classes]({{ site.baseurl }}/docs/{{ site.docs_version }}/utilities/text/#text-alignment).
{% example html %}
-<div class="card" style="width: 20rem;">
+<div class="card" style="width: 18rem;">
<div class="card-body">
<h4 class="card-title">Special title treatment</h4>
<p class="card-text">With supporting text below as a natural lead-in to additional content.</p>
</div>
</div>
-<div class="card text-center" style="width: 20rem;">
+<div class="card text-center" style="width: 18rem;">
<div class="card-body">
<h4 class="card-title">Special title treatment</h4>
<p class="card-text">With supporting text below as a natural lead-in to additional content.</p>
</div>
</div>
-<div class="card text-right" style="width: 20rem;">
+<div class="card text-right" style="width: 18rem;">
<div class="card-body">
<h4 class="card-title">Special title treatment</h4>
<p class="card-text">With supporting text below as a natural lead-in to additional content.</p>
{% example html %}
{% for color in site.data.theme-colors %}
-<div class="card{% unless color.name == "light" %} text-white{% endunless %} bg-{{ color.name }} mb-3" style="max-width: 20rem;">
+<div class="card{% unless color.name == "light" %} text-white{% endunless %} bg-{{ color.name }} mb-3" style="max-width: 18rem;">
<div class="card-header">Header</div>
<div class="card-body">
<h4 class="card-title">{{ color.name | capitalize }} card title</h4>
{% example html %}
{% for color in site.data.theme-colors %}
-<div class="card border-{{ color.name }} mb-3" style="max-width: 20rem;">
+<div class="card border-{{ color.name }} mb-3" style="max-width: 18rem;">
<div class="card-header">Header</div>
<div class="card-body{% unless color.name == "light" %} text-{{ color.name }}{% endunless %}">
<h4 class="card-title">{{ color.name | capitalize }} card title</h4>
You can also change the borders on the card header and footer as needed, and even remove their `background-color` with `.bg-transparent`.
{% example html %}
-<div class="card border-success mb-3" style="max-width: 20rem;">
+<div class="card border-success mb-3" style="max-width: 18rem;">
<div class="card-header bg-transparent border-success">Header</div>
<div class="card-body text-success">
<h4 class="card-title">Success card title</h4>
{% example html %}
<div class="btn-group">
<button type="button" class="btn btn-secondary dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
- This dropdown's menu is right-aligned
+ Right-aligned menu
</button>
<div class="dropdown-menu dropdown-menu-right">
<button class="dropdown-item" type="button">Action</button>
{% example html %}
<div class="jumbotron">
- <h1 class="display-3">Hello, world!</h1>
+ <h1 class="display-4">Hello, world!</h1>
<p class="lead">This is a simple hero unit, a simple jumbotron-style component for calling extra attention to featured content or information.</p>
<hr class="my-4">
<p>It uses utility classes for typography and spacing to space content out within the larger container.</p>
{% example html %}
<div class="jumbotron jumbotron-fluid">
<div class="container">
- <h1 class="display-3">Fluid jumbotron</h1>
+ <h1 class="display-4">Fluid jumbotron</h1>
<p class="lead">This is a modified jumbotron that occupies the entire horizontal space of its parent.</p>
</div>
</div>
<nav aria-label="...">
<ul class="pagination pagination-lg">
<li class="page-item disabled">
- <a class="page-link" href="#" tabindex="-1">Previous</a>
+ <a class="page-link" href="#" tabindex="-1">1</a>
</li>
- <li class="page-item"><a class="page-link" href="#">1</a></li>
<li class="page-item"><a class="page-link" href="#">2</a></li>
<li class="page-item"><a class="page-link" href="#">3</a></li>
- <li class="page-item">
- <a class="page-link" href="#">Next</a>
- </li>
</ul>
</nav>
{% endexample %}
<nav aria-label="...">
<ul class="pagination pagination-sm">
<li class="page-item disabled">
- <a class="page-link" href="#" tabindex="-1">Previous</a>
+ <a class="page-link" href="#" tabindex="-1">1</a>
</li>
- <li class="page-item"><a class="page-link" href="#">1</a></li>
<li class="page-item"><a class="page-link" href="#">2</a></li>
<li class="page-item"><a class="page-link" href="#">3</a></li>
- <li class="page-item">
- <a class="page-link" href="#">Next</a>
- </li>
</ul>
</nav>
{% endexample %}
<thead>
<tr>
<th scope="col">#</th>
- <th scope="col">First Name</th>
- <th scope="col">Last Name</th>
- <th scope="col">Username</th>
+ <th scope="col">First</th>
+ <th scope="col">Last</th>
+ <th scope="col">Handle</th>
</tr>
</thead>
<tbody>
<thead>
<tr>
<th scope="col">#</th>
- <th scope="col">First Name</th>
- <th scope="col">Last Name</th>
- <th scope="col">Username</th>
+ <th scope="col">First</th>
+ <th scope="col">Last</th>
+ <th scope="col">Handle</th>
</tr>
</thead>
<tbody>
<thead class="thead-dark">
<tr>
<th scope="col">#</th>
- <th scope="col">First Name</th>
- <th scope="col">Last Name</th>
- <th scope="col">Username</th>
+ <th scope="col">First</th>
+ <th scope="col">Last</th>
+ <th scope="col">Handle</th>
</tr>
</thead>
<tbody>
<thead class="thead-light">
<tr>
<th scope="col">#</th>
- <th scope="col">First Name</th>
- <th scope="col">Last Name</th>
- <th scope="col">Username</th>
+ <th scope="col">First</th>
+ <th scope="col">Last</th>
+ <th scope="col">Handle</th>
</tr>
</thead>
<tbody>
<thead>
<tr>
<th scope="col">#</th>
- <th scope="col">First Name</th>
- <th scope="col">Last Name</th>
- <th scope="col">Username</th>
+ <th scope="col">First</th>
+ <th scope="col">Last</th>
+ <th scope="col">Handle</th>
</tr>
</thead>
<tbody>
<thead>
<tr>
<th scope="col">#</th>
- <th scope="col">First Name</th>
- <th scope="col">Last Name</th>
- <th scope="col">Username</th>
+ <th scope="col">First</th>
+ <th scope="col">Last</th>
+ <th scope="col">Handle</th>
</tr>
</thead>
<tbody>
<thead>
<tr>
<th scope="col">#</th>
- <th scope="col">First Name</th>
- <th scope="col">Last Name</th>
- <th scope="col">Username</th>
+ <th scope="col">First</th>
+ <th scope="col">Last</th>
+ <th scope="col">Handle</th>
</tr>
</thead>
<tbody>
</tr>
<tr>
<th scope="row">2</th>
- <td>Mark</td>
- <td>Otto</td>
- <td>@TwBootstrap</td>
- </tr>
- <tr>
- <th scope="row">3</th>
<td>Jacob</td>
<td>Thornton</td>
<td>@fat</td>
</tr>
<tr>
- <th scope="row">4</th>
+ <th scope="row">3</th>
<td colspan="2">Larry the Bird</td>
<td>@twitter</td>
</tr>
<thead>
<tr>
<th scope="col">#</th>
- <th scope="col">First Name</th>
- <th scope="col">Last Name</th>
- <th scope="col">Username</th>
+ <th scope="col">First</th>
+ <th scope="col">Last</th>
+ <th scope="col">Handle</th>
</tr>
</thead>
<tbody>
</tr>
<tr>
<th scope="row">2</th>
- <td>Mark</td>
- <td>Otto</td>
- <td>@TwBootstrap</td>
- </tr>
- <tr>
- <th scope="row">3</th>
<td>Jacob</td>
<td>Thornton</td>
<td>@fat</td>
</tr>
<tr>
- <th scope="row">4</th>
+ <th scope="row">3</th>
<td colspan="2">Larry the Bird</td>
<td>@twitter</td>
</tr>
<thead>
<tr>
<th scope="col">#</th>
- <th scope="col">First Name</th>
- <th scope="col">Last Name</th>
- <th scope="col">Username</th>
+ <th scope="col">First</th>
+ <th scope="col">Last</th>
+ <th scope="col">Handle</th>
</tr>
</thead>
<tbody>
<thead>
<tr>
<th scope="col">#</th>
- <th scope="col">First Name</th>
- <th scope="col">Last Name</th>
- <th scope="col">Username</th>
+ <th scope="col">First</th>
+ <th scope="col">Last</th>
+ <th scope="col">Handle</th>
</tr>
</thead>
<tbody>
<thead>
<tr>
<th scope="col">#</th>
- <th scope="col">First Name</th>
- <th scope="col">Last Name</th>
- <th scope="col">Username</th>
+ <th scope="col">First</th>
+ <th scope="col">Last</th>
+ <th scope="col">Handle</th>
</tr>
</thead>
<tbody>
<thead>
<tr>
<th scope="col">#</th>
- <th scope="col">First Name</th>
- <th scope="col">Last Name</th>
- <th scope="col">Username</th>
+ <th scope="col">First</th>
+ <th scope="col">Last</th>
+ <th scope="col">Handle</th>
</tr>
</thead>
<tbody>
<table class="table">
<thead>
<tr>
- <th scope="col">Type</th>
- <th scope="col">Column heading</th>
- <th scope="col">Column heading</th>
- <th scope="col">Column heading</th>
+ <th scope="col">Class</th>
+ <th scope="col">Heading</th>
+ <th scope="col">Heading</th>
</tr>
</thead>
<tbody>
<tr class="table-active">
<th scope="row">Active</th>
- <td>Column content</td>
- <td>Column content</td>
- <td>Column content</td>
+ <td>Cell</td>
+ <td>Cell</td>
</tr>
<tr>
<th scope="row">Default</th>
- <td>Column content</td>
- <td>Column content</td>
- <td>Column content</td>
+ <td>Cell</td>
+ <td>Cell</td>
</tr>
{% for color in site.data.theme-colors %}
<tr class="table-{{ color.name }}">
<th scope="row">{{ color.name | capitalize }}</th>
- <td>Column content</td>
- <td>Column content</td>
- <td>Column content</td>
+ <td>Cell</td>
+ <td>Cell</td>
</tr>{% endfor %}
</tbody>
</table>
<thead>
<tr>
<th scope="col">#</th>
- <th scope="col">Column heading</th>
- <th scope="col">Column heading</th>
- <th scope="col">Column heading</th>
+ <th scope="col">Heading</th>
+ <th scope="col">Heading</th>
</tr>
</thead>
<tbody>
<tr class="bg-primary">
<th scope="row">1</th>
- <td>Column content</td>
- <td>Column content</td>
- <td>Column content</td>
+ <td>Cell</td>
+ <td>Cell</td>
</tr>
<tr>
<th scope="row">2</th>
- <td>Column content</td>
- <td>Column content</td>
- <td>Column content</td>
+ <td>Cell</td>
+ <td>Cell</td>
</tr>
<tr class="bg-success">
<th scope="row">3</th>
- <td>Column content</td>
- <td>Column content</td>
- <td>Column content</td>
+ <td>Cell</td>
+ <td>Cell</td>
</tr>
<tr>
<th scope="row">4</th>
- <td>Column content</td>
- <td>Column content</td>
- <td>Column content</td>
+ <td>Cell</td>
+ <td>Cell</td>
</tr>
<tr class="bg-info">
<th scope="row">5</th>
- <td>Column content</td>
- <td>Column content</td>
- <td>Column content</td>
+ <td>Cell</td>
+ <td>Cell</td>
</tr>
<tr>
<th scope="row">6</th>
- <td>Column content</td>
- <td>Column content</td>
- <td>Column content</td>
+ <td>Cell</td>
+ <td>Cell</td>
</tr>
<tr class="bg-warning">
<th scope="row">7</th>
- <td>Column content</td>
- <td>Column content</td>
- <td>Column content</td>
+ <td>Cell</td>
+ <td>Cell</td>
</tr>
<tr>
<th scope="row">8</th>
- <td>Column content</td>
- <td>Column content</td>
- <td>Column content</td>
+ <td>Cell</td>
+ <td>Cell</td>
</tr>
<tr class="bg-danger">
<th scope="row">9</th>
- <td>Column content</td>
- <td>Column content</td>
- <td>Column content</td>
+ <td>Cell</td>
+ <td>Cell</td>
</tr>
</tbody>
</table>
<thead>
<tr>
<th scope="col">#</th>
- <th scope="col">First Name</th>
- <th scope="col">Last Name</th>
- <th scope="col">Username</th>
+ <th scope="col">First</th>
+ <th scope="col">Last</th>
+ <th scope="col">Handle</th>
</tr>
</thead>
<tbody>
Change how flex items wrap in a flex container. Choose from no wrapping at all (the browser default) with `.flex-nowrap`, wrapping with `.flex-wrap`, or reverse wrapping with `.flex-wrap-reverse`.
<div class="bd-example">
- <div class="d-flex flex-nowrap bd-highlight">
- <div class="p-2 bd-highlight">Flex item</div>
- <div class="p-2 bd-highlight">Flex item</div>
- <div class="p-2 bd-highlight">Flex item</div>
- <div class="p-2 bd-highlight">Flex item</div>
- <div class="p-2 bd-highlight">Flex item</div>
- <div class="p-2 bd-highlight">Flex item</div>
- <div class="p-2 bd-highlight">Flex item</div>
- <div class="p-2 bd-highlight">Flex item</div>
- <div class="p-2 bd-highlight">Flex item</div>
- <div class="p-2 bd-highlight">Flex item</div>
+ <div class="d-flex flex-nowrap bd-highlight" style="width: 8rem;">
<div class="p-2 bd-highlight">Flex item</div>
<div class="p-2 bd-highlight">Flex item</div>
<div class="p-2 bd-highlight">Flex item</div>
Prevent text from wrapping with a `.text-nowrap` class.
{% example html %}
-<div class="row">
- <div class="col-1 text-nowrap">
- Curabitur blandit tempus ardua ridiculus sed magna.
- </div>
- <div class="col-11">
- <img data-src="holder.js/50x50" alt="An image to show the text doesn't wrap">
- </div>
+<div class="text-nowrap bd-highlight" style="width: 8rem;">
+ This text should overflow the parent.
</div>
{% endexample %}
// Inline code
code {
- padding: $code-padding-y $code-padding-x;
font-size: $code-font-size;
color: $code-color;
- background-color: $code-bg;
- @include border-radius($border-radius);
+ word-break: break-word;
// Streamline the style when inside anchors to avoid broken underline and more
a > & {
- padding: 0;
color: inherit;
- background-color: inherit;
}
}
// User input typically entered via keyboard
kbd {
- padding: $code-padding-y $code-padding-x;
- font-size: $code-font-size;
+ padding: $kbd-padding-y $kbd-padding-x;
+ font-size: $kbd-font-size;
color: $kbd-color;
background-color: $kbd-bg;
@include border-radius($border-radius-sm);
// Account for some code outputs that place code tags in pre tags
code {
- padding: 0;
font-size: inherit;
color: inherit;
- background-color: transparent;
- @include border-radius(0);
+ word-break: normal;
}
}
.form-control-file,
.form-control-range {
display: block;
+ width: 100%;
}
// Custom file inputs have more complex markup, thus requiring different
// border-radius overrides.
.custom-file {
+ display: flex;
+ align-items: center;
+ width: 100%;
+
+ .custom-file-input {
+ width: 100%;
+ min-width: 0;
+ }
+
&:not(:first-child):not(:last-of-type) .custom-file-control,
&:not(:first-child):not(:last-of-type) .custom-file-control::before { @include border-radius(0); }
&:first-child .custom-file-control,
&:last-of-type:not(:first-child) .custom-file-control,
&:last-of-type:not(:first-child) .custom-file-control::before { @include border-left-radius(0); }
}
+
+ .custom-select {
+ width: 100%;
+ }
}
// Code
-$code-font-size: 90% !default;
-$code-padding-y: .2rem !default;
-$code-padding-x: .4rem !default;
-$code-color: #bd4147 !default;
-$code-bg: $gray-100 !default;
+$code-font-size: 87.5% !default;
+$code-color: $pink !default;
+$kbd-padding-y: .2rem !default;
+$kbd-padding-x: .4rem !default;
+$kbd-font-size: $code-font-size !default;
$kbd-color: $white !default;
$kbd-bg: $gray-900 !default;