mirror of
https://github.com/Hopiu/bootstrap.git
synced 2026-03-26 01:00:24 +00:00
Merge branch 'v4-docs-streamlined' of https://github.com/twbs/bootstrap into v4-docs-streamlined
This commit is contained in:
commit
6c3f833076
267 changed files with 18919 additions and 27287 deletions
|
|
@ -10,6 +10,7 @@ javascript:
|
|||
eslint:
|
||||
enabled: true
|
||||
config_file: js/.eslintrc.json
|
||||
ignore_file: .houndignore
|
||||
|
||||
jscs:
|
||||
enabled: true
|
||||
|
|
|
|||
4
.houndignore
Normal file
4
.houndignore
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
**/*.min.js
|
||||
**/vendor/*
|
||||
**/dist/*
|
||||
js/tests/*
|
||||
26
.travis.yml
26
.travis.yml
|
|
@ -1,39 +1,33 @@
|
|||
sudo: required
|
||||
sudo: false
|
||||
dist: trusty
|
||||
language: node_js
|
||||
git:
|
||||
depth: 10
|
||||
depth: 3
|
||||
node_js:
|
||||
- "4"
|
||||
- "6"
|
||||
before_install:
|
||||
# Remove ./node_modules/.bin from PATH so node-which doesn't replace Unix which and cause RVM to barf. See https://github.com/travis-ci/travis-ci/issues/5092
|
||||
- export PATH=$(python -c 'from sys import argv;from collections import OrderedDict as od;print(":".join(od((p,None) for p in argv[1].split(":") if p.startswith("/")).keys()))' "$PATH")
|
||||
- rvm install 2.2
|
||||
- rvm use 2.2 --fuzzy
|
||||
- npm install -g npm@3
|
||||
- "export TRAVIS_COMMIT_MSG=\"$(git log --format=%B --no-merges -n 1)\""
|
||||
- if [[ `npm -v` != 3* ]]; then npm install -g npm@3; fi
|
||||
- "export TRAVIS_COMMIT_MSG=\"`git log --format=%B --no-merges -n 1`\""
|
||||
- echo "$TRAVIS_COMMIT_MSG" | grep '\[skip validator\]'; export TWBS_DO_VALIDATOR=$?; true
|
||||
- echo "$TRAVIS_COMMIT_MSG" | grep '\[skip sauce\]'; export TWBS_DO_SAUCE=$?; true
|
||||
- if [ "$TRAVIS_REPO_SLUG" = twbs-savage/bootstrap ]; then export TWBS_DO_VALIDATOR=0; fi
|
||||
install:
|
||||
- bundle install --deployment --jobs=3
|
||||
- bundle install --deployment --jobs=3 --retry=3
|
||||
- cp grunt/npm-shrinkwrap.json ./
|
||||
- npm install
|
||||
after_success:
|
||||
- if [ "$TWBS_TEST" = sauce-js-unit ]; then grunt/upload-preview.sh; fi
|
||||
cache:
|
||||
directories:
|
||||
- node_modules
|
||||
- vendor/bundle
|
||||
- "$HOME/google-cloud-sdk"
|
||||
env:
|
||||
global:
|
||||
- NPM_CONFIG_PROGRESS="false"
|
||||
matrix:
|
||||
- TWBS_TEST=core
|
||||
- TWBS_TEST=validate-html
|
||||
- TWBS_TEST=sauce-js-unit
|
||||
- TWBS_TEST=core
|
||||
- TWBS_TEST=validate-html
|
||||
- TWBS_TEST=sauce-js-unit
|
||||
matrix:
|
||||
fast_finish: true
|
||||
exclude:
|
||||
- node_js: "4"
|
||||
env: TWBS_TEST=validate-html
|
||||
|
|
|
|||
|
|
@ -73,7 +73,7 @@ Guidelines for bug reports:
|
|||
|
||||
3. **Isolate the problem** — ideally create a [reduced test
|
||||
case](https://css-tricks.com/reduced-test-cases/) and a live example.
|
||||
[This JS Bin](https://jsbin.com/qusafa/edit?html,output) is a helpful template.
|
||||
[This JS Bin](https://jsbin.com/lolome/edit?html,output) is a helpful template.
|
||||
|
||||
|
||||
A good bug report shouldn't leave others needing to chase you up for more
|
||||
|
|
|
|||
98
Gruntfile.js
98
Gruntfile.js
|
|
@ -39,7 +39,7 @@ module.exports = function (grunt) {
|
|||
' * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n' +
|
||||
' */\n',
|
||||
jqueryCheck: 'if (typeof jQuery === \'undefined\') {\n' +
|
||||
' throw new Error(\'Bootstrap\\\'s JavaScript requires jQuery\')\n' +
|
||||
' throw new Error(\'Bootstrap\\\'s JavaScript requires jQuery. jQuery must be included before Bootstrap\\\'s JavaScript.\')\n' +
|
||||
'}\n',
|
||||
jqueryVersionCheck: '+function ($) {\n' +
|
||||
' var version = $.fn.jquery.split(\' \')[0].split(\'.\')\n' +
|
||||
|
|
@ -121,24 +121,6 @@ module.exports = function (grunt) {
|
|||
}
|
||||
},
|
||||
|
||||
uglify: {
|
||||
options: {
|
||||
compress: {
|
||||
warnings: false
|
||||
},
|
||||
mangle: true,
|
||||
preserveComments: /^!|@preserve|@license|@cc_on/i
|
||||
},
|
||||
core: {
|
||||
src: '<%= concat.bootstrap.dest %>',
|
||||
dest: 'dist/js/<%= pkg.name %>.min.js'
|
||||
},
|
||||
docsJs: {
|
||||
src: configBridge.paths.docsJs,
|
||||
dest: 'docs/assets/js/docs.min.js'
|
||||
}
|
||||
},
|
||||
|
||||
qunit: {
|
||||
options: {
|
||||
inject: 'js/tests/unit/phantom.js'
|
||||
|
|
@ -147,51 +129,6 @@ module.exports = function (grunt) {
|
|||
},
|
||||
|
||||
// CSS build configuration
|
||||
scsslint: {
|
||||
options: {
|
||||
bundleExec: true,
|
||||
config: 'scss/.scss-lint.yml',
|
||||
reporterOutput: null
|
||||
},
|
||||
core: {
|
||||
src: ['scss/*.scss', '!scss/_normalize.scss']
|
||||
},
|
||||
docs: {
|
||||
src: ['docs/assets/scss/*.scss', '!docs/assets/scss/docs.scss']
|
||||
}
|
||||
},
|
||||
|
||||
cssmin: {
|
||||
options: {
|
||||
compatibility: 'ie9,-properties.zeroUnits',
|
||||
sourceMap: true,
|
||||
// sourceMapInlineSources: true,
|
||||
advanced: false
|
||||
},
|
||||
core: {
|
||||
files: [
|
||||
{
|
||||
expand: true,
|
||||
cwd: 'dist/css',
|
||||
src: ['*.css', '!*.min.css'],
|
||||
dest: 'dist/css',
|
||||
ext: '.min.css'
|
||||
}
|
||||
]
|
||||
},
|
||||
docs: {
|
||||
files: [
|
||||
{
|
||||
expand: true,
|
||||
cwd: 'docs/assets/css',
|
||||
src: ['*.css', '!*.min.css'],
|
||||
dest: 'docs/assets/css',
|
||||
ext: '.min.css'
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
|
||||
copy: {
|
||||
docs: {
|
||||
expand: true,
|
||||
|
|
@ -275,6 +212,12 @@ module.exports = function (grunt) {
|
|||
},
|
||||
|
||||
exec: {
|
||||
'clean-css': {
|
||||
command: 'npm run clean-css'
|
||||
},
|
||||
'clean-css-docs': {
|
||||
command: 'npm run clean-css-docs'
|
||||
},
|
||||
postcss: {
|
||||
command: 'npm run postcss'
|
||||
},
|
||||
|
|
@ -284,8 +227,17 @@ module.exports = function (grunt) {
|
|||
htmlhint: {
|
||||
command: 'npm run htmlhint'
|
||||
},
|
||||
'upload-preview': {
|
||||
command: './grunt/upload-preview.sh'
|
||||
'scss-lint': {
|
||||
command: 'npm run scss-lint'
|
||||
},
|
||||
'scss-lint-docs': {
|
||||
command: 'npm run scss-lint-docs'
|
||||
},
|
||||
uglify: {
|
||||
command: 'npm run uglify'
|
||||
},
|
||||
'uglify-docs': {
|
||||
command: 'npm run uglify-docs'
|
||||
}
|
||||
},
|
||||
|
||||
|
|
@ -361,7 +313,7 @@ module.exports = function (grunt) {
|
|||
if (typeof process.env.SAUCE_ACCESS_KEY !== 'undefined' &&
|
||||
// Skip Sauce if running a different subset of the test suite
|
||||
runSubset('sauce-js-unit')) {
|
||||
testSubtasks = testSubtasks.concat(['dist', 'docs-css', 'docs-js', 'clean:docs', 'copy:docs', 'exec:upload-preview']);
|
||||
testSubtasks = testSubtasks.concat(['dist', 'docs-css', 'docs-js', 'clean:docs', 'copy:docs']);
|
||||
// Skip Sauce on Travis when [skip sauce] is in the commit message
|
||||
if (isUndefOrNonZero(process.env.TWBS_DO_SAUCE)) {
|
||||
testSubtasks.push('connect');
|
||||
|
|
@ -371,9 +323,9 @@ module.exports = function (grunt) {
|
|||
grunt.registerTask('test', testSubtasks);
|
||||
|
||||
// JS distribution task.
|
||||
grunt.registerTask('dist-js', ['babel:dev', 'concat', 'babel:dist', 'stamp', 'uglify:core']);
|
||||
grunt.registerTask('dist-js', ['babel:dev', 'concat', 'babel:dist', 'stamp', 'exec:uglify']);
|
||||
|
||||
grunt.registerTask('test-scss', ['scsslint:core']);
|
||||
grunt.registerTask('test-scss', ['exec:scss-lint']);
|
||||
|
||||
// CSS distribution task.
|
||||
// Supported Compilers: sass (Ruby) and libsass.
|
||||
|
|
@ -383,7 +335,7 @@ module.exports = function (grunt) {
|
|||
// grunt.registerTask('sass-compile', ['sass:core', 'sass:extras', 'sass:docs']);
|
||||
grunt.registerTask('sass-compile', ['sass:core', 'sass:extras', 'sass:docs']);
|
||||
|
||||
grunt.registerTask('dist-css', ['sass-compile', 'exec:postcss', 'cssmin:core', 'cssmin:docs']);
|
||||
grunt.registerTask('dist-css', ['sass-compile', 'exec:postcss', 'exec:clean-css', 'exec:clean-css-docs']);
|
||||
|
||||
// Full distribution task.
|
||||
grunt.registerTask('dist', ['clean:dist', 'dist-css', 'dist-js']);
|
||||
|
|
@ -392,9 +344,9 @@ module.exports = function (grunt) {
|
|||
grunt.registerTask('default', ['clean:dist', 'test']);
|
||||
|
||||
// Docs task.
|
||||
grunt.registerTask('docs-css', ['cssmin:docs', 'exec:postcss-docs']);
|
||||
grunt.registerTask('lint-docs-css', ['scsslint:docs']);
|
||||
grunt.registerTask('docs-js', ['uglify:docsJs']);
|
||||
grunt.registerTask('docs-css', ['exec:clean-css-docs', 'exec:postcss-docs']);
|
||||
grunt.registerTask('lint-docs-css', ['exec:scss-lint-docs']);
|
||||
grunt.registerTask('docs-js', ['exec:uglify-docs']);
|
||||
grunt.registerTask('docs', ['lint-docs-css', 'docs-css', 'docs-js', 'clean:docs', 'copy:docs']);
|
||||
grunt.registerTask('docs-github', ['jekyll:github']);
|
||||
|
||||
|
|
|
|||
12
README.md
12
README.md
|
|
@ -8,7 +8,7 @@
|
|||
[](https://david-dm.org/twbs/bootstrap?type=dev)
|
||||
[](https://atmospherejs.com/twbs/bootstrap)
|
||||
[](https://packagist.org/packages/twbs/bootstrap)
|
||||
[](https://www.nuget.org/packages/bootstrap/4.0.0-alpha4)
|
||||
[](https://www.nuget.org/packages/bootstrap/4.0.0-alpha5)
|
||||
|
||||
[](https://saucelabs.com/u/bootstrap)
|
||||
|
||||
|
|
@ -31,12 +31,12 @@ To get started, check out <https://getbootstrap.com>!
|
|||
|
||||
Several quick start options are available:
|
||||
|
||||
- [Download the latest release.](https://github.com/twbs/bootstrap/archive/v4.0.0-alpha.4.zip)
|
||||
- [Download the latest release.](https://github.com/twbs/bootstrap/archive/v4.0.0-alpha.5.zip)
|
||||
- Clone the repo: `git clone https://github.com/twbs/bootstrap.git`
|
||||
- Install with [npm](https://www.npmjs.com): `npm install bootstrap@4.0.0-alpha.4`
|
||||
- Install with [Meteor](https://www.meteor.com): `meteor add twbs:bootstrap@=4.0.0-alpha.4`
|
||||
- Install with [Composer](https://getcomposer.org): `composer require twbs/bootstrap`
|
||||
- Install with [Bower](https://bower.io): `bower install bootstrap#v4.0.0-alpha.4`
|
||||
- Install with [npm](https://www.npmjs.com): `npm install bootstrap@4.0.0-alpha.5`
|
||||
- Install with [yarn](https://github.com/yarnpkg/yarn): `yarn add bootstrap@4.0.0-alpha.5`
|
||||
- Install with [Composer](https://getcomposer.org): `composer require twbs/bootstrap:4.0.0-alpha.5`
|
||||
- Install with [Bower](https://bower.io): `bower install bootstrap#v4.0.0-alpha.5`
|
||||
- Install with [NuGet](https://www.nuget.org): CSS: `Install-Package bootstrap -Pre` Sass: `Install-Package bootstrap.sass -Pre` (`-Pre` is only required until Bootstrap v4 has a stable release).
|
||||
|
||||
Read the [Getting started page](https://getbootstrap.com/getting-started/) for information on the framework contents, templates and examples, and more.
|
||||
|
|
|
|||
16
_config.yml
16
_config.yml
|
|
@ -31,13 +31,13 @@ social_logo_path: /assets/brand/bootstrap-social-logo.png
|
|||
social_image_path: /assets/brand/bootstrap-social.png
|
||||
|
||||
# Custom vars
|
||||
current_version: 4.0.0-alpha.4
|
||||
current_version: 4.0.0-alpha.5
|
||||
repo: https://github.com/twbs/bootstrap
|
||||
slack: https://bootstrap-slack.herokuapp.com
|
||||
|
||||
download:
|
||||
source: https://github.com/twbs/bootstrap/archive/v4.0.0-alpha.4.zip
|
||||
dist: https://github.com/twbs/bootstrap/releases/download/v4.0.0-alpha.4/bootstrap-4.0.0-alpha.4-dist.zip
|
||||
source: https://github.com/twbs/bootstrap/archive/v4.0.0-alpha.5.zip
|
||||
dist: https://github.com/twbs/bootstrap/releases/download/v4.0.0-alpha.5/bootstrap-4.0.0-alpha.5-dist.zip
|
||||
|
||||
blog: https://blog.getbootstrap.com
|
||||
expo: https://expo.getbootstrap.com
|
||||
|
|
@ -45,11 +45,11 @@ themes: https://themes.getbootstrap.com
|
|||
|
||||
cdn:
|
||||
# See https://www.srihash.org for info on how to generate the hashes
|
||||
css: https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.4/css/bootstrap.min.css
|
||||
css_hash: "sha384-2hfp1SzUoho7/TsGGGDaFdsuuDL0LX2hnUp6VkX3CUQ2K4K+xjboZdsXyp4oUHZj"
|
||||
js: https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.4/js/bootstrap.min.js
|
||||
js_hash: "sha384-VjEeINv9OSwtWFLAtmc4JCtEJXXBub00gtSnszmspDLCtC0I4z4nqz7rEFbIZLLU"
|
||||
jquery: https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js
|
||||
css: https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.5/css/bootstrap.min.css
|
||||
css_hash: "sha384-AysaV+vQoT3kOAXZkl02PThvDr8HYKPZhNT5h/CXfBThSRXQ6jW5DO2ekP5ViFdi"
|
||||
js: https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.5/js/bootstrap.min.js
|
||||
js_hash: "sha384-BLiI7JTZm+JWlgKa0M0kGRpJbF2J8q+qreVrKBC47e3K6BW78kGLrCkeRX6I9RoK"
|
||||
jquery: https://code.jquery.com/jquery-3.1.1.min.js
|
||||
jquery_hash: "sha384-3ceskX3iaEnIogmQchP8opvBy3Mi7Ce34nWjpBIwVTHfGYWQS9jwHDVRnpKKHJg7"
|
||||
tether: https://cdnjs.cloudflare.com/ajax/libs/tether/1.3.7/js/tether.min.js
|
||||
tether_hash: "sha384-XTs3FgkjiBgo8qjEjBk0tGmf3wPrWtA6coPfQDfFEY8AnYJwjalXCiosYRBIBZX8"
|
||||
|
|
|
|||
7203
dist/css/bootstrap-flex.css
vendored
7203
dist/css/bootstrap-flex.css
vendored
File diff suppressed because it is too large
Load diff
BIN
dist/css/bootstrap-flex.css.map
vendored
BIN
dist/css/bootstrap-flex.css.map
vendored
Binary file not shown.
7
dist/css/bootstrap-flex.min.css
vendored
7
dist/css/bootstrap-flex.min.css
vendored
File diff suppressed because one or more lines are too long
BIN
dist/css/bootstrap-flex.min.css.map
vendored
BIN
dist/css/bootstrap-flex.min.css.map
vendored
Binary file not shown.
721
dist/css/bootstrap-grid.css
vendored
721
dist/css/bootstrap-grid.css
vendored
File diff suppressed because it is too large
Load diff
BIN
dist/css/bootstrap-grid.css.map
vendored
BIN
dist/css/bootstrap-grid.css.map
vendored
Binary file not shown.
3
dist/css/bootstrap-grid.min.css
vendored
3
dist/css/bootstrap-grid.min.css
vendored
File diff suppressed because one or more lines are too long
BIN
dist/css/bootstrap-grid.min.css.map
vendored
BIN
dist/css/bootstrap-grid.min.css.map
vendored
Binary file not shown.
132
dist/css/bootstrap-reboot.css
vendored
132
dist/css/bootstrap-reboot.css
vendored
|
|
@ -1,4 +1,4 @@
|
|||
/*! normalize.css v4.2.0 | MIT License | github.com/necolas/normalize.css */
|
||||
/*! normalize.css v5.0.0 | MIT License | github.com/necolas/normalize.css */
|
||||
html {
|
||||
font-family: sans-serif;
|
||||
line-height: 1.15;
|
||||
|
|
@ -12,38 +12,38 @@ body {
|
|||
|
||||
article,
|
||||
aside,
|
||||
details,
|
||||
figcaption,
|
||||
figure,
|
||||
footer,
|
||||
header,
|
||||
main,
|
||||
menu,
|
||||
nav,
|
||||
section,
|
||||
summary {
|
||||
section {
|
||||
display: block;
|
||||
}
|
||||
|
||||
audio,
|
||||
canvas,
|
||||
progress,
|
||||
video {
|
||||
display: inline-block;
|
||||
h1 {
|
||||
font-size: 2em;
|
||||
margin: 0.67em 0;
|
||||
}
|
||||
|
||||
audio:not([controls]) {
|
||||
display: none;
|
||||
figcaption,
|
||||
figure,
|
||||
main {
|
||||
display: block;
|
||||
}
|
||||
|
||||
figure {
|
||||
margin: 1em 40px;
|
||||
}
|
||||
|
||||
hr {
|
||||
-webkit-box-sizing: content-box;
|
||||
box-sizing: content-box;
|
||||
height: 0;
|
||||
overflow: visible;
|
||||
}
|
||||
|
||||
progress {
|
||||
vertical-align: baseline;
|
||||
}
|
||||
|
||||
template,
|
||||
[hidden] {
|
||||
display: none;
|
||||
pre {
|
||||
font-family: monospace, monospace;
|
||||
font-size: 1em;
|
||||
}
|
||||
|
||||
a {
|
||||
|
|
@ -72,13 +72,15 @@ strong {
|
|||
font-weight: bolder;
|
||||
}
|
||||
|
||||
dfn {
|
||||
font-style: italic;
|
||||
code,
|
||||
kbd,
|
||||
samp {
|
||||
font-family: monospace, monospace;
|
||||
font-size: 1em;
|
||||
}
|
||||
|
||||
h1 {
|
||||
font-size: 2em;
|
||||
margin: 0.67em 0;
|
||||
dfn {
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
mark {
|
||||
|
|
@ -106,6 +108,16 @@ sup {
|
|||
top: -0.5em;
|
||||
}
|
||||
|
||||
audio,
|
||||
video {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
audio:not([controls]) {
|
||||
display: none;
|
||||
height: 0;
|
||||
}
|
||||
|
||||
img {
|
||||
border-style: none;
|
||||
}
|
||||
|
|
@ -114,38 +126,17 @@ svg:not(:root) {
|
|||
overflow: hidden;
|
||||
}
|
||||
|
||||
code,
|
||||
kbd,
|
||||
pre,
|
||||
samp {
|
||||
font-family: monospace, monospace;
|
||||
font-size: 1em;
|
||||
}
|
||||
|
||||
figure {
|
||||
margin: 1em 40px;
|
||||
}
|
||||
|
||||
hr {
|
||||
-webkit-box-sizing: content-box;
|
||||
box-sizing: content-box;
|
||||
height: 0;
|
||||
overflow: visible;
|
||||
}
|
||||
|
||||
button,
|
||||
input,
|
||||
optgroup,
|
||||
select,
|
||||
textarea {
|
||||
font: inherit;
|
||||
font-family: sans-serif;
|
||||
font-size: 100%;
|
||||
line-height: 1.15;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
optgroup {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
button,
|
||||
input {
|
||||
overflow: visible;
|
||||
|
|
@ -194,6 +185,11 @@ legend {
|
|||
white-space: normal;
|
||||
}
|
||||
|
||||
progress {
|
||||
display: inline-block;
|
||||
vertical-align: baseline;
|
||||
}
|
||||
|
||||
textarea {
|
||||
overflow: auto;
|
||||
}
|
||||
|
|
@ -220,16 +216,32 @@ textarea {
|
|||
-webkit-appearance: none;
|
||||
}
|
||||
|
||||
::-webkit-input-placeholder {
|
||||
color: inherit;
|
||||
opacity: 0.54;
|
||||
}
|
||||
|
||||
::-webkit-file-upload-button {
|
||||
-webkit-appearance: button;
|
||||
font: inherit;
|
||||
}
|
||||
|
||||
details,
|
||||
menu {
|
||||
display: block;
|
||||
}
|
||||
|
||||
summary {
|
||||
display: list-item;
|
||||
}
|
||||
|
||||
canvas {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
template {
|
||||
display: none;
|
||||
}
|
||||
|
||||
[hidden] {
|
||||
display: none;
|
||||
}
|
||||
|
||||
html {
|
||||
-webkit-box-sizing: border-box;
|
||||
box-sizing: border-box;
|
||||
|
|
@ -253,10 +265,11 @@ html {
|
|||
}
|
||||
|
||||
body {
|
||||
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
|
||||
font-family: -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
|
||||
font-size: 1rem;
|
||||
font-weight: normal;
|
||||
line-height: 1.5;
|
||||
color: #373a3c;
|
||||
color: #292b2c;
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
|
|
@ -277,7 +290,6 @@ p {
|
|||
abbr[title],
|
||||
abbr[data-original-title] {
|
||||
cursor: help;
|
||||
border-bottom: 1px dotted #818a91;
|
||||
}
|
||||
|
||||
address {
|
||||
|
|
@ -381,7 +393,7 @@ table {
|
|||
caption {
|
||||
padding-top: 0.75rem;
|
||||
padding-bottom: 0.75rem;
|
||||
color: #818a91;
|
||||
color: #636c72;
|
||||
text-align: left;
|
||||
caption-side: bottom;
|
||||
}
|
||||
|
|
|
|||
BIN
dist/css/bootstrap-reboot.css.map
vendored
BIN
dist/css/bootstrap-reboot.css.map
vendored
Binary file not shown.
3
dist/css/bootstrap-reboot.min.css
vendored
3
dist/css/bootstrap-reboot.min.css
vendored
|
|
@ -1,2 +1 @@
|
|||
/*! normalize.css v4.2.0 | MIT License | github.com/necolas/normalize.css */html{font-family:sans-serif;line-height:1.15;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}body{margin:0}article,aside,details,figcaption,figure,footer,header,main,menu,nav,section,summary{display:block}audio,canvas,progress,video{display:inline-block}audio:not([controls]){display:none;height:0}progress{vertical-align:baseline}[hidden],template{display:none}a{background-color:transparent;-webkit-text-decoration-skip:objects}a:active,a:hover{outline-width:0}abbr[title]{border-bottom:none;text-decoration:underline;text-decoration:underline dotted}b,strong{font-weight:inherit}b,strong{font-weight:bolder}dfn{font-style:italic}h1{font-size:2em;margin:.67em 0}mark{background-color:#ff0;color:#000}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}img{border-style:none}svg:not(:root){overflow:hidden}code,kbd,pre,samp{font-family:monospace,monospace;font-size:1em}figure{margin:1em 40px}hr{-webkit-box-sizing:content-box;box-sizing:content-box;height:0;overflow:visible}button,input,optgroup,select,textarea{font:inherit;margin:0}optgroup{font-weight:700}button,input{overflow:visible}button,select{text-transform:none}[type=reset],[type=submit],button,html [type=button]{-webkit-appearance:button}[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner,button::-moz-focus-inner{border-style:none;padding:0}[type=button]:-moz-focusring,[type=reset]:-moz-focusring,[type=submit]:-moz-focusring,button:-moz-focusring{outline:1px dotted ButtonText}fieldset{border:1px solid silver;margin:0 2px;padding:.35em .625em .75em}legend{-webkit-box-sizing:border-box;box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal}textarea{overflow:auto}[type=checkbox],[type=radio]{-webkit-box-sizing:border-box;box-sizing:border-box;padding:0}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}[type=search]::-webkit-search-cancel-button,[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-input-placeholder{color:inherit;opacity:.54}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}html{-webkit-box-sizing:border-box;box-sizing:border-box}*,::after,::before{-webkit-box-sizing:inherit;box-sizing:inherit}@-ms-viewport{width:device-width}html{font-size:16px;-ms-overflow-style:scrollbar;-webkit-tap-highlight-color:transparent}body{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;font-size:1rem;line-height:1.5;color:#373a3c;background-color:#fff}[tabindex="-1"]:focus{outline:0!important}h1,h2,h3,h4,h5,h6{margin-top:0;margin-bottom:.5rem}p{margin-top:0;margin-bottom:1rem}abbr[data-original-title],abbr[title]{cursor:help;border-bottom:1px dotted #818a91}address{margin-bottom:1rem;font-style:normal;line-height:inherit}dl,ol,ul{margin-top:0;margin-bottom:1rem}ol ol,ol ul,ul ol,ul ul{margin-bottom:0}dt{font-weight:700}dd{margin-bottom:.5rem;margin-left:0}blockquote{margin:0 0 1rem}a{color:#0275d8;text-decoration:none}a:focus,a:hover{color:#014c8c;text-decoration:underline}a:focus{outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}a:not([href]):not([tabindex]){color:inherit;text-decoration:none}a:not([href]):not([tabindex]):focus,a:not([href]):not([tabindex]):hover{color:inherit;text-decoration:none}a:not([href]):not([tabindex]):focus{outline:0}pre{margin-top:0;margin-bottom:1rem;overflow:auto}figure{margin:0 0 1rem}img{vertical-align:middle}[role=button]{cursor:pointer}[role=button],a,area,button,input,label,select,summary,textarea{-ms-touch-action:manipulation;touch-action:manipulation}table{border-collapse:collapse;background-color:transparent}caption{padding-top:.75rem;padding-bottom:.75rem;color:#818a91;text-align:left;caption-side:bottom}th{text-align:left}label{display:inline-block;margin-bottom:.5rem}button:focus{outline:1px dotted;outline:5px auto -webkit-focus-ring-color}button,input,select,textarea{line-height:inherit}input[type=checkbox]:disabled,input[type=radio]:disabled{cursor:not-allowed}input[type=date],input[type=time],input[type=datetime-local],input[type=month]{-webkit-appearance:listbox}textarea{resize:vertical}fieldset{min-width:0;padding:0;margin:0;border:0}legend{display:block;width:100%;padding:0;margin-bottom:.5rem;font-size:1.5rem;line-height:inherit}input[type=search]{-webkit-appearance:none}output{display:inline-block}[hidden]{display:none!important}
|
||||
/*# sourceMappingURL=bootstrap-reboot.min.css.map */
|
||||
/*! normalize.css v5.0.0 | MIT License | github.com/necolas/normalize.css */html{font-family:sans-serif;line-height:1.15;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}body{margin:0}article,aside,footer,header,nav,section{display:block}h1{font-size:2em;margin:.67em 0}figcaption,figure,main{display:block}figure{margin:1em 40px}hr{-webkit-box-sizing:content-box;box-sizing:content-box;height:0;overflow:visible}pre{font-family:monospace,monospace;font-size:1em}a{background-color:transparent;-webkit-text-decoration-skip:objects}a:active,a:hover{outline-width:0}abbr[title]{border-bottom:none;text-decoration:underline;text-decoration:underline dotted}b,strong{font-weight:inherit}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace,monospace;font-size:1em}dfn{font-style:italic}mark{background-color:#ff0;color:#000}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}audio,video{display:inline-block}audio:not([controls]){display:none;height:0}img{border-style:none}svg:not(:root){overflow:hidden}button,input,optgroup,select,textarea{font-family:sans-serif;font-size:100%;line-height:1.15;margin:0}button,input{overflow:visible}button,select{text-transform:none}[type=reset],[type=submit],button,html [type=button]{-webkit-appearance:button}[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner,button::-moz-focus-inner{border-style:none;padding:0}[type=button]:-moz-focusring,[type=reset]:-moz-focusring,[type=submit]:-moz-focusring,button:-moz-focusring{outline:1px dotted ButtonText}fieldset{border:1px solid silver;margin:0 2px;padding:.35em .625em .75em}legend{-webkit-box-sizing:border-box;box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal}progress{display:inline-block;vertical-align:baseline}textarea{overflow:auto}[type=checkbox],[type=radio]{-webkit-box-sizing:border-box;box-sizing:border-box;padding:0}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}[type=search]::-webkit-search-cancel-button,[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}details,menu{display:block}summary{display:list-item}canvas{display:inline-block}template{display:none}[hidden]{display:none}html{-webkit-box-sizing:border-box;box-sizing:border-box}*,::after,::before{-webkit-box-sizing:inherit;box-sizing:inherit}@-ms-viewport{width:device-width}html{font-size:16px;-ms-overflow-style:scrollbar;-webkit-tap-highlight-color:transparent}body{font-family:-apple-system,system-ui,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;font-size:1rem;font-weight:400;line-height:1.5;color:#292b2c;background-color:#fff}[tabindex="-1"]:focus{outline:0!important}h1,h2,h3,h4,h5,h6{margin-top:0;margin-bottom:.5rem}p{margin-top:0;margin-bottom:1rem}abbr[data-original-title],abbr[title]{cursor:help}address{margin-bottom:1rem;font-style:normal;line-height:inherit}dl,ol,ul{margin-top:0;margin-bottom:1rem}ol ol,ol ul,ul ol,ul ul{margin-bottom:0}dt{font-weight:700}dd{margin-bottom:.5rem;margin-left:0}blockquote{margin:0 0 1rem}a{color:#0275d8;text-decoration:none}a:focus,a:hover{color:#014c8c;text-decoration:underline}a:focus{outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}a:not([href]):not([tabindex]){color:inherit;text-decoration:none}a:not([href]):not([tabindex]):focus,a:not([href]):not([tabindex]):hover{color:inherit;text-decoration:none}a:not([href]):not([tabindex]):focus{outline:0}pre{margin-top:0;margin-bottom:1rem;overflow:auto}figure{margin:0 0 1rem}img{vertical-align:middle}[role=button]{cursor:pointer}[role=button],a,area,button,input,label,select,summary,textarea{-ms-touch-action:manipulation;touch-action:manipulation}table{border-collapse:collapse;background-color:transparent}caption{padding-top:.75rem;padding-bottom:.75rem;color:#636c72;text-align:left;caption-side:bottom}th{text-align:left}label{display:inline-block;margin-bottom:.5rem}button:focus{outline:1px dotted;outline:5px auto -webkit-focus-ring-color}button,input,select,textarea{line-height:inherit}input[type=checkbox]:disabled,input[type=radio]:disabled{cursor:not-allowed}input[type=date],input[type=time],input[type=datetime-local],input[type=month]{-webkit-appearance:listbox}textarea{resize:vertical}fieldset{min-width:0;padding:0;margin:0;border:0}legend{display:block;width:100%;padding:0;margin-bottom:.5rem;font-size:1.5rem;line-height:inherit}input[type=search]{-webkit-appearance:none}output{display:inline-block}[hidden]{display:none!important}/*# sourceMappingURL=bootstrap-reboot.min.css.map */
|
||||
BIN
dist/css/bootstrap-reboot.min.css.map
vendored
BIN
dist/css/bootstrap-reboot.min.css.map
vendored
Binary file not shown.
File diff suppressed because it is too large
Load diff
BIN
dist/css/bootstrap.css.map
vendored
BIN
dist/css/bootstrap.css.map
vendored
Binary file not shown.
5
dist/css/bootstrap.min.css
vendored
5
dist/css/bootstrap.min.css
vendored
File diff suppressed because one or more lines are too long
BIN
dist/css/bootstrap.min.css.map
vendored
BIN
dist/css/bootstrap.min.css.map
vendored
Binary file not shown.
File diff suppressed because it is too large
Load diff
6
dist/js/bootstrap.min.js
vendored
6
dist/js/bootstrap.min.js
vendored
File diff suppressed because one or more lines are too long
29
docs/_data/breakpoints.yml
Normal file
29
docs/_data/breakpoints.yml
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
- breakpoint: xs
|
||||
abbr: ""
|
||||
name: Extra small
|
||||
min-width: 0px
|
||||
container: ""
|
||||
|
||||
- breakpoint: sm
|
||||
abbr: -sm
|
||||
name: Small
|
||||
min-width: 576px
|
||||
container: 540px
|
||||
|
||||
- breakpoint: md
|
||||
abbr: -md
|
||||
name: Medium
|
||||
min-width: 768px
|
||||
container: 720px
|
||||
|
||||
- breakpoint: lg
|
||||
abbr: -lg
|
||||
name: Large
|
||||
min-width: 992px
|
||||
container: 960px
|
||||
|
||||
- breakpoint: xl
|
||||
abbr: -xl
|
||||
name: Extra large
|
||||
min-width: 1200px
|
||||
container: 1140px
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
-
|
||||
browser: >
|
||||
Microsoft Edge
|
||||
Edge
|
||||
summary: >
|
||||
Visual artifacts in scrollable modal dialogs
|
||||
upstream_bug: >
|
||||
|
|
@ -10,7 +10,7 @@
|
|||
|
||||
-
|
||||
browser: >
|
||||
Microsoft Edge
|
||||
Edge
|
||||
summary: >
|
||||
Native browser tooltip for `title` shows on first keyboard focus (in addition to custom tooltip component)
|
||||
upstream_bug: >
|
||||
|
|
@ -20,7 +20,7 @@
|
|||
|
||||
-
|
||||
browser: >
|
||||
Microsoft Edge
|
||||
Edge
|
||||
summary: >
|
||||
Hovered element still remains in `:hover` state after scrolling away.
|
||||
upstream_bug: >
|
||||
|
|
@ -30,7 +30,7 @@
|
|||
|
||||
-
|
||||
browser: >
|
||||
Microsoft Edge
|
||||
Edge
|
||||
summary: >
|
||||
When hovering over a `<select>` menu item, the cursor for the element underneath the menu is displayed.
|
||||
upstream_bug: >
|
||||
|
|
@ -40,7 +40,7 @@
|
|||
|
||||
-
|
||||
browser: >
|
||||
Microsoft Edge
|
||||
Edge
|
||||
summary: >
|
||||
CSS `border-radius` sometimes causes lines of bleed-through of the `background-color` of the parent element.
|
||||
upstream_bug: >
|
||||
|
|
@ -50,7 +50,7 @@
|
|||
|
||||
-
|
||||
browser: >
|
||||
Microsoft Edge
|
||||
Edge
|
||||
summary: >
|
||||
`background` of `<tr>` is only applied to first child cell instead of all cells in the row
|
||||
upstream_bug: >
|
||||
|
|
@ -60,7 +60,7 @@
|
|||
|
||||
-
|
||||
browser: >
|
||||
Microsoft Edge
|
||||
Edge
|
||||
summary: >
|
||||
`@-ms-viewport{width: device-width;}` has side-effect of making scrollbars auto-hide
|
||||
upstream_bug: >
|
||||
|
|
@ -70,7 +70,7 @@
|
|||
|
||||
-
|
||||
browser: >
|
||||
Microsoft Edge
|
||||
Edge
|
||||
summary: >
|
||||
Background color from lower layer bleeds through transparent border in some cases
|
||||
upstream_bug: >
|
||||
|
|
@ -80,7 +80,7 @@
|
|||
|
||||
-
|
||||
browser: >
|
||||
Microsoft Edge
|
||||
Edge
|
||||
summary: >
|
||||
Hovering over descendant SVG element fires `mouseleave` event at ancestor
|
||||
upstream_bug: >
|
||||
|
|
@ -90,7 +90,7 @@
|
|||
|
||||
-
|
||||
browser: >
|
||||
Microsoft Edge
|
||||
Edge
|
||||
summary: >
|
||||
Active `position: fixed;` `<button>` flickers when scrolling
|
||||
upstream_bug: >
|
||||
|
|
@ -162,11 +162,11 @@
|
|||
browser: >
|
||||
Firefox
|
||||
summary: >
|
||||
`min-width: 0` has no effect on `<fieldset>`
|
||||
Layout with floated columns breaks when printing
|
||||
upstream_bug: >
|
||||
Mozilla#504622
|
||||
Mozilla#1315994
|
||||
origin: >
|
||||
Bootstrap#12359
|
||||
Bootstrap#21092
|
||||
|
||||
-
|
||||
browser: >
|
||||
|
|
@ -234,7 +234,7 @@
|
|||
summary: >
|
||||
`table-cell` borders not overlapping despite `margin-right: -1px`
|
||||
upstream_bug: >
|
||||
Chromium#534750
|
||||
Chromium#568691
|
||||
origin: >
|
||||
Bootstrap#17438, Bootstrap#14237
|
||||
|
||||
|
|
@ -268,6 +268,16 @@
|
|||
origin: >
|
||||
Bootstrap#15298
|
||||
|
||||
-
|
||||
browser: >
|
||||
Chrome (Linux)
|
||||
summary: >
|
||||
`<select>`'s pop-up menu is blank on some systems.
|
||||
upstream_bug: >
|
||||
Chromium#510079
|
||||
origin: >
|
||||
Bootstrap#21120
|
||||
|
||||
-
|
||||
browser: >
|
||||
Safari
|
||||
|
|
@ -278,6 +288,16 @@
|
|||
origin: >
|
||||
Bootstrap#17403
|
||||
|
||||
-
|
||||
browser: >
|
||||
Safari
|
||||
summary: >
|
||||
Link to container with id and tabindex results in container being ignored by VoiceOver (affects skip links)
|
||||
upstream_bug: >
|
||||
WebKit#163658
|
||||
origin: >
|
||||
Bootstrap#20732
|
||||
|
||||
-
|
||||
browser: >
|
||||
Safari (OS X)
|
||||
|
|
@ -310,16 +330,6 @@
|
|||
origin: >
|
||||
Bootstrap#14868
|
||||
|
||||
-
|
||||
browser: >
|
||||
Safari (iPad)
|
||||
summary: >
|
||||
`<select>` menu on iPad causes shifting of hit-testing areas
|
||||
upstream_bug: >
|
||||
WebKit#150079, Safari#23082521
|
||||
origin: >
|
||||
Bootstrap#14975
|
||||
|
||||
-
|
||||
browser: >
|
||||
Safari (iOS)
|
||||
|
|
@ -440,6 +450,16 @@
|
|||
origin: >
|
||||
Bootstrap#12832
|
||||
|
||||
-
|
||||
browser: >
|
||||
Safari (iOS)
|
||||
summary: >
|
||||
Element which is `position:fixed` disappears after opening a `<select>` menu
|
||||
upstream_bug: >
|
||||
WebKit#162362
|
||||
origin: >
|
||||
Bootstrap#20759
|
||||
|
||||
-
|
||||
browser: >
|
||||
Safari (iPad Pro)
|
||||
|
|
|
|||
|
|
@ -1,6 +1,16 @@
|
|||
-
|
||||
browser: >
|
||||
Microsoft Edge
|
||||
Edge
|
||||
summary: >
|
||||
Focusable elements should fire focus event / receive :focus styling when they receive Narrator/accessibility focus
|
||||
upstream_bug: >
|
||||
A11yUserVoice#16717318
|
||||
origin: >
|
||||
Bootstrap#20732
|
||||
|
||||
-
|
||||
browser: >
|
||||
Edge
|
||||
summary: >
|
||||
Implement the [`:dir()` pseudo-class](https://developer.mozilla.org/en-US/docs/Web/CSS/:dir) from Selectors Level 4
|
||||
upstream_bug: >
|
||||
|
|
@ -10,7 +20,7 @@
|
|||
|
||||
-
|
||||
browser: >
|
||||
Microsoft Edge
|
||||
Edge
|
||||
summary: >
|
||||
Implement [sticky positioning](http://html5please.com/#position:sticky) from CSS Positioned Layout Level 3
|
||||
upstream_bug: >
|
||||
|
|
@ -20,7 +30,7 @@
|
|||
|
||||
-
|
||||
browser: >
|
||||
Microsoft Edge
|
||||
Edge
|
||||
summary: >
|
||||
Implement the HTML5 [`<dialog>` element](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/dialog)
|
||||
upstream_bug: >
|
||||
|
|
@ -30,7 +40,7 @@
|
|||
|
||||
-
|
||||
browser: >
|
||||
Microsoft Edge
|
||||
Edge
|
||||
summary: >
|
||||
Fire a [`transitioncancel` event](https://developer.mozilla.org/en-US/docs/Web/Events/transitioncancel) when a CSS transition is canceled
|
||||
upstream_bug: >
|
||||
|
|
@ -40,7 +50,7 @@
|
|||
|
||||
-
|
||||
browser: >
|
||||
Microsoft Edge
|
||||
Edge
|
||||
summary: >
|
||||
Implement the [`of <selector-list>` clause](http://caniuse.com/#feat=css-nth-child-of) of the `:nth-child()` pseudo-class
|
||||
upstream_bug: >
|
||||
|
|
@ -78,6 +88,16 @@
|
|||
origin: >
|
||||
Bootstrap#20175
|
||||
|
||||
-
|
||||
browser: >
|
||||
Firefox
|
||||
summary: >
|
||||
When virtual focus is on a button or link, fire actual focus on the element, too
|
||||
upstream_bug: >
|
||||
Mozilla#1000082
|
||||
origin: >
|
||||
Bootstrap#20732
|
||||
|
||||
-
|
||||
browser: >
|
||||
Chrome
|
||||
|
|
@ -108,16 +128,6 @@
|
|||
origin: >
|
||||
Bootstrap#19984
|
||||
|
||||
-
|
||||
browser: >
|
||||
Chrome
|
||||
summary: >
|
||||
Implement [sticky positioning](http://html5please.com/#position:sticky) from CSS Positioned Layout Level 3
|
||||
upstream_bug: >
|
||||
Chromium#231752
|
||||
origin: >
|
||||
Bootstrap#17021
|
||||
|
||||
-
|
||||
browser: >
|
||||
Safari
|
||||
|
|
|
|||
|
|
@ -6,7 +6,6 @@
|
|||
- title: Browsers & devices
|
||||
- title: JavaScript
|
||||
- title: Options
|
||||
- title: Flexbox
|
||||
- title: Build tools
|
||||
- title: Best practices
|
||||
- title: Accessibility
|
||||
|
|
@ -15,7 +14,6 @@
|
|||
pages:
|
||||
- title: Overview
|
||||
- title: Grid
|
||||
- title: Flexbox grid
|
||||
- title: Media object
|
||||
- title: Responsive utilities
|
||||
|
||||
|
|
@ -31,6 +29,7 @@
|
|||
- title: Components
|
||||
pages:
|
||||
- title: Alerts
|
||||
- title: Badge
|
||||
- title: Breadcrumb
|
||||
- title: Buttons
|
||||
- title: Button group
|
||||
|
|
@ -49,7 +48,6 @@
|
|||
- title: Popovers
|
||||
- title: Progress
|
||||
- title: Scrollspy
|
||||
- title: Tag
|
||||
- title: Tooltips
|
||||
|
||||
- title: Utilities
|
||||
|
|
@ -58,6 +56,7 @@
|
|||
- title: Clearfix
|
||||
- title: Close icon
|
||||
- title: Colors
|
||||
- title: Flexbox
|
||||
- title: Display property
|
||||
- title: Image replacement
|
||||
- title: Invisible content
|
||||
|
|
@ -66,6 +65,7 @@
|
|||
- title: Sizing and positioning
|
||||
- title: Spacing
|
||||
- title: Typography
|
||||
- title: Vertical align
|
||||
|
||||
# - title: Extend
|
||||
# pages:
|
||||
|
|
|
|||
|
|
@ -15,9 +15,6 @@
|
|||
<!-- Bootstrap core CSS -->
|
||||
{% if site.github %}
|
||||
<link href="{{ site.baseurl }}/dist/css/bootstrap.min.css" rel="stylesheet">
|
||||
{% if page.title == "Flexbox grid system" %}
|
||||
<link href="{{ site.baseurl }}/assets/css/docs-flexbox.min.css" rel="stylesheet">
|
||||
{% endif %}
|
||||
{% else %}
|
||||
<link href="{{ site.baseurl }}/dist/css/bootstrap.css" rel="stylesheet">
|
||||
{% endif %}
|
||||
|
|
@ -33,7 +30,7 @@
|
|||
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
|
||||
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
|
||||
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
|
||||
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
|
||||
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
|
||||
ga('create', 'UA-146052-10', 'getbootstrap.com');
|
||||
ga('send', 'pageview');
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -1,34 +1,31 @@
|
|||
<nav class="bd-links" id="docsNavbarContent">
|
||||
{% assign page_slug = page.url | split: '/' | last %}
|
||||
{% for group in site.data.nav %}
|
||||
{% assign link = group.pages | first %}
|
||||
{% assign slug = group.title | downcase | replace: ' ', '-' || page.title | downcase | replace: ' ', '-' | append: '/' %}
|
||||
{% assign link_slug = link.title | slugify %}
|
||||
{% assign group_slug = group.title | slugify %}
|
||||
{% assign active = nil %}
|
||||
|
||||
{% if page.url contains slug %}
|
||||
{% if page.group == group_slug %}
|
||||
{% assign active = 'active' %}
|
||||
{% endif %}
|
||||
|
||||
<div class="bd-toc-item {{ active }}">
|
||||
{% if slug == "examples" %}
|
||||
<a class="bd-toc-link" href="{{ site.baseurl }}/{{ group.title | downcase | replace: ' ', '-' }}/">
|
||||
{% else %}
|
||||
<a class="bd-toc-link" href="{{ site.baseurl }}/{{ group.title | downcase | replace: ' ', '-' }}/{{ link.title | downcase | replace: ' ', '-' || page.title | downcase | replace: ' ', '-' }}">
|
||||
{% endif %}
|
||||
<a class="bd-toc-link" href="{{ site.baseurl }}/{{ group_slug }}/{{ link_slug }}{% if link_slug %}/{% endif %}">
|
||||
{{ group.title }}
|
||||
</a>
|
||||
|
||||
<ul class="nav bd-sidenav">
|
||||
{% for doc in group.pages %}
|
||||
{% assign slug = doc.title | downcase | replace: ' ', '-' | replace:'-&-','-' %}
|
||||
{% capture slug %}/{{ slug }}{% endcapture %}
|
||||
{% assign doc_slug = doc.title | slugify %}
|
||||
{% assign active = nil %}
|
||||
|
||||
{% if page.url contains slug %}
|
||||
{% if page.group == group_slug and page_slug == doc_slug %}
|
||||
{% assign active = 'active bd-sidenav-active' %}
|
||||
{% endif %}
|
||||
|
||||
<li class="{{ active }}">
|
||||
<a href="{{ site.baseurl }}/{{ group.title | downcase | replace: ' ', '-' }}/{{ doc.title | downcase | replace: ' ', '-' | replace:'-&-','-' }}/">
|
||||
<a href="{{ site.baseurl }}/{{ group_slug }}/{{ doc_slug }}/">
|
||||
{{ doc.title }}
|
||||
</a>
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
<header class="navbar navbar-light navbar-static-top bd-navbar">
|
||||
<div class="container">
|
||||
<header class="navbar navbar-toggleable-md navbar-light bd-navbar">
|
||||
<nav class="container">
|
||||
{% comment %}
|
||||
<nav class="nav navbar-nav float-xs-right">
|
||||
<nav class="nav navbar-nav float-right">
|
||||
<div class="nav-item dropdown">
|
||||
<a class="nav-item nav-link dropdown-toggle" href="#" id="bd-versions" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||
v{{ site.current_version }}
|
||||
|
|
@ -25,40 +25,39 @@
|
|||
</nav>
|
||||
{% endcomment %}
|
||||
|
||||
<nav>
|
||||
<div class="clearfix">
|
||||
<button class="navbar-toggler float-xs-right hidden-sm-up" type="button" data-toggle="collapse" data-target="#bd-main-nav" aria-controls="bd-main-nav" aria-expanded="false" aria-label="Toggle navigation"></button>
|
||||
<a class="navbar-brand hidden-sm-up" href="{{ site.baseurl }}/">
|
||||
Bootstrap
|
||||
</a>
|
||||
</div>
|
||||
<div class="collapse navbar-toggleable-xs" id="bd-main-nav">
|
||||
<ul class="nav navbar-nav">
|
||||
<li class="nav-item active">
|
||||
<a class="nav-item nav-link {% if page.layout == "home" %}active{% endif %}" href="{{ site.baseurl }}/" onclick="ga('send', 'event', 'Navbar', 'Community links', 'Bootstrap');">Bootstrap</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-item nav-link {% if page.layout == "docs" %}active{% endif %}" href="{{ site.baseurl }}/getting-started/introduction/" onclick="ga('send', 'event', 'Navbar', 'Community links', 'Docs');">Documentation</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-item nav-link {% if page.title == "Examples" %}active{% endif %}" href="{{ site.baseurl }}/examples/" onclick="ga('send', 'event', 'Navbar', 'Community links', 'Examples');">Examples</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-item nav-link" href="{{ site.themes }}" onclick="ga('send', 'event', 'Navbar', 'Community links', 'Themes');">Themes</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-item nav-link" href="{{ site.expo }}" onclick="ga('send', 'event', 'Navbar', 'Community links', 'Expo');">Expo</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-item nav-link" href="{{ site.blog }}" onclick="ga('send', 'event', 'Navbar', 'Community links', 'Blog');">Blog</a>
|
||||
</li>
|
||||
</ul>
|
||||
<a class="navbar-brand" href="{{ site.baseurl }}/">
|
||||
Bootstrap
|
||||
</a>
|
||||
<button class="navbar-toggler navbar-toggler-right" type="button" data-toggle="collapse" data-target="#bd-main-nav" aria-controls="bd-main-nav" aria-expanded="false" aria-label="Toggle navigation">
|
||||
<span class="navbar-toggler-icon"></span>
|
||||
</button>
|
||||
|
||||
<form class="bd-search hidden-sm-down float-md-right">
|
||||
<input type="text" class="form-control" id="search-input" placeholder="Search..." autocomplete="off">
|
||||
<div class="dropdown-menu bd-search-results" id="search-results"></div>
|
||||
</form>
|
||||
</div>
|
||||
</nav>
|
||||
</div>
|
||||
<div class="collapse navbar-collapse" id="bd-main-nav">
|
||||
<ul class="navbar-nav mr-auto">
|
||||
<li class="nav-item {% if page.layout == "home" %}active{% endif %}">
|
||||
<a class="nav-link" href="{{ site.baseurl }}/" onclick="ga('send', 'event', 'Navbar', 'Community links', 'Bootstrap');">Home</a>
|
||||
</li>
|
||||
<li class="nav-item {% if page.layout == "docs" %}active{% endif %}">
|
||||
<a class="nav-link" href="{{ site.baseurl }}/getting-started/introduction/" onclick="ga('send', 'event', 'Navbar', 'Community links', 'Docs');">Documentation</a>
|
||||
</li>
|
||||
<li class="nav-item {% if page.title == "Examples" %}active{% endif %}">
|
||||
<a class="nav-link" href="{{ site.baseurl }}/examples/" onclick="ga('send', 'event', 'Navbar', 'Community links', 'Examples');">Examples</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="{{ site.themes }}" onclick="ga('send', 'event', 'Navbar', 'Community links', 'Themes');">Themes</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="{{ site.expo }}" onclick="ga('send', 'event', 'Navbar', 'Community links', 'Expo');">Expo</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="{{ site.blog }}" onclick="ga('send', 'event', 'Navbar', 'Community links', 'Blog');">Blog</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<form class="bd-search">
|
||||
<input type="text" class="form-control" id="search-input" placeholder="Search..." autocomplete="off">
|
||||
<div class="dropdown-menu bd-search-results" id="search-results"></div>
|
||||
</form>
|
||||
</div>
|
||||
</nav>
|
||||
</header>
|
||||
|
|
|
|||
|
|
@ -12,19 +12,12 @@
|
|||
|
||||
{% include nav-home.html %}
|
||||
|
||||
<!-- <div class="bd-pageheader">
|
||||
<div class="container">
|
||||
{% include page-headers.html %}
|
||||
{% include ads.html %}
|
||||
</div>
|
||||
</div> -->
|
||||
|
||||
<div class="container">
|
||||
<div class="container mt-4">
|
||||
<div class="row">
|
||||
<div class="col-xs-12 col-md-3 bd-sidebar">
|
||||
<div class="col-12 col-md-3 bd-sidebar">
|
||||
{% include nav-docs.html %}
|
||||
</div>
|
||||
<div class="col-xs-12 col-md-9 bd-content">
|
||||
<div class="col-12 col-md-9 bd-content">
|
||||
<h1 class="bd-title" id="content">{{ page.title }}</h1>
|
||||
{{ content }}
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
layout: default
|
||||
---
|
||||
|
||||
<div class="bd-pageheader text-xs-center text-sm-left">
|
||||
<div class="bd-pageheader text-center text-sm-left">
|
||||
<div class="container">
|
||||
<h1>{{ page.title }}</h1>
|
||||
<p class="lead">
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ module Jekyll
|
|||
upstream_map = {
|
||||
"Bootstrap" => "https://github.com/twbs/bootstrap/issues/",
|
||||
"Edge" => ["https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/", "Edge issue"],
|
||||
"A11yUserVoice" => ["https://microsoftaccessibility.uservoice.com/forums/307429-microsoft-accessibility-feedback/suggestions/", "Microsoft A11y UserVoice idea"],
|
||||
"UserVoice" => ["https://wpdev.uservoice.com/forums/257854-microsoft-edge-developer/suggestions/", "Edge UserVoice idea"],
|
||||
"Mozilla" => ["https://bugzilla.mozilla.org/show_bug.cgi?id=", "Mozilla bug"],
|
||||
"Chromium" => ["https://bugs.chromium.org/p/chromium/issues/detail?id=", "Chromium issue"],
|
||||
|
|
|
|||
|
|
@ -57,16 +57,26 @@ eos
|
|||
def example(output)
|
||||
"<div class=\"bd-example\" data-example-id=\"#{@options[:id]}\">\n#{output}\n</div>"
|
||||
end
|
||||
|
||||
|
||||
def remove_holderjs(code)
|
||||
code = code.gsub(/data-src="holder.js.+?"/, 'src="..."')
|
||||
end
|
||||
|
||||
def remove_example_classes(code)
|
||||
# Find `bd-` classes and remove them from the highlighted code. Because of how this regex works, it will also
|
||||
# remove classes that are after the `bd-` class. While this is a bug, I left it because it can be helpful too.
|
||||
# To fix the bug, replace `(?=")` with `(?=("|\ ))`.
|
||||
code = code.gsub(/(?!class=".)\ *?bd-.+?(?=")/, "")
|
||||
# Find empty class attributes after the previous regex and remove those too.
|
||||
code = code.gsub(/\ class=""/, "")
|
||||
end
|
||||
|
||||
def render_rouge(code)
|
||||
require 'rouge'
|
||||
formatter = Rouge::Formatters::HTML.new(line_numbers: @options[:linenos], wrap: false)
|
||||
lexer = Rouge::Lexer.find_fancy(@lang, code) || Rouge::Lexers::PlainText
|
||||
code = remove_holderjs(code)
|
||||
code = remove_example_classes(code)
|
||||
code = formatter.format(lexer.lex(code))
|
||||
"<div class=\"highlight\"><pre>#{code}</pre></div>"
|
||||
end
|
||||
|
|
|
|||
|
|
@ -7,6 +7,11 @@ group: about
|
|||
|
||||
Have a need for Bootstrap's brand resources? Great! We have only a few guidelines we follow, and in turn ask you to follow as well. These guidelines were inspired by MailChimp's [Brand Assets](https://mailchimp.com/about/brand-assets/).
|
||||
|
||||
## Contents
|
||||
|
||||
* Will be replaced with the ToC, excluding the "Contents" header
|
||||
{:toc}
|
||||
|
||||
## Mark and logo
|
||||
|
||||
Use either the Bootstrap mark (a capital **B**) or the standard logo (just **Bootstrap**). It should always appear in Helvetica Neue Bold. **Do not use the Twitter bird** in association with Bootstrap.
|
||||
|
|
|
|||
|
|
@ -10,4 +10,4 @@ Originally created by a designer and a developer at Twitter, Bootstrap has becom
|
|||
|
||||
Bootstrap was created at Twitter in mid-2010 by [@mdo](https://twitter.com/mdo) and [@fat](https://twitter.com/fat). Prior to being an open-sourced framework, Bootstrap was known as _Twitter Blueprint_. A few months into development, Twitter held its [first Hack Week](https://blog.twitter.com/2010/hack-week) and the project exploded as developers of all skill levels jumped in without any external guidance. It served as the style guide for internal tools development at the company for over a year before its public release, and continues to do so today.
|
||||
|
||||
Originally [released](https://blog.twitter.com/2011/bootstrap-twitter) on [<time datetime="2011-08-19 11:25">Friday, August 19, 2011</time>](https://twitter.com/mdo/statuses/104620039650557952), we've since had over [twenty releases](https://github.com/twbs/bootstrap/releases), including two major rewrites with v2 and v3. With Bootstrap 2, we added responsive functionality to the entire framework as an optional stylesheet. Building on that with Bootstrap 3, we rewrote the library once more to make it responsive by default with a mobile first approach.
|
||||
Originally [released](https://blog.twitter.com/2011/bootstrap-from-twitter) on [<time datetime="2011-08-19 11:25">Friday, August 19, 2011</time>](https://twitter.com/mdo/statuses/104620039650557952), we've since had over [twenty releases](https://github.com/twbs/bootstrap/releases), including two major rewrites with v2 and v3. With Bootstrap 2, we added responsive functionality to the entire framework as an optional stylesheet. Building on that with Bootstrap 3, we rewrote the library once more to make it responsive by default with a mobile first approach.
|
||||
|
|
|
|||
1280
docs/assets/css/docs-flexbox.min.css
vendored
1280
docs/assets/css/docs-flexbox.min.css
vendored
File diff suppressed because it is too large
Load diff
Binary file not shown.
1534
docs/assets/css/docs.min.css
vendored
1534
docs/assets/css/docs.min.css
vendored
File diff suppressed because one or more lines are too long
Binary file not shown.
14
docs/assets/js/docs.min.js
vendored
14
docs/assets/js/docs.min.js
vendored
File diff suppressed because one or more lines are too long
|
|
@ -33,7 +33,7 @@
|
|||
$('.bd-example-indeterminate [type="checkbox"]').prop('indeterminate', true)
|
||||
|
||||
// Disable empty links in docs examples
|
||||
$('.bd-example [href="#"]').click(function (e) {
|
||||
$('.bd-content [href="#"]').click(function (e) {
|
||||
e.preventDefault()
|
||||
})
|
||||
|
||||
|
|
@ -73,7 +73,8 @@
|
|||
})
|
||||
|
||||
clipboard.on('error', function (e) {
|
||||
var fallbackMsg = /Mac/i.test(navigator.userAgent) ? 'Press \u2318 to copy' : 'Press Ctrl-C to copy'
|
||||
var modifierKey = /Mac/i.test(navigator.userAgent) ? '\u2318' : 'Ctrl-'
|
||||
var fallbackMsg = 'Press ' + modifierKey + 'C to copy'
|
||||
|
||||
$(e.trigger)
|
||||
.attr('title', fallbackMsg)
|
||||
|
|
|
|||
|
|
@ -19,9 +19,9 @@
|
|||
}
|
||||
}
|
||||
|
||||
.flex-items-xs-top,
|
||||
.flex-items-xs-middle,
|
||||
.flex-items-xs-bottom {
|
||||
.flex-items-top,
|
||||
.flex-items-middle,
|
||||
.flex-items-bottom {
|
||||
min-height: 6rem;
|
||||
background-color: rgba(255,0,0,.1);
|
||||
}
|
||||
|
|
@ -32,6 +32,11 @@
|
|||
background-color: rgba(255,0,0,.1);
|
||||
}
|
||||
|
||||
.bd-highlight {
|
||||
background-color: rgba($bd-purple, .15);
|
||||
border: 1px solid rgba($bd-purple, .15);
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// Container illustrations
|
||||
|
|
@ -100,9 +105,13 @@
|
|||
margin-top: 2rem;
|
||||
}
|
||||
|
||||
// Undo width of container
|
||||
.container {
|
||||
width: auto;
|
||||
.pos-f-t {
|
||||
position: relative;
|
||||
margin: -1rem;
|
||||
|
||||
@include media-breakpoint-up(sm) {
|
||||
margin: -1.5rem;
|
||||
}
|
||||
}
|
||||
|
||||
> .form-control {
|
||||
|
|
@ -111,11 +120,6 @@
|
|||
}
|
||||
}
|
||||
|
||||
// Card examples should be horizontal
|
||||
> .card {
|
||||
max-width: 20rem;
|
||||
}
|
||||
|
||||
> .nav + .nav,
|
||||
> .alert + .alert,
|
||||
> .navbar + .navbar,
|
||||
|
|
@ -226,21 +230,23 @@
|
|||
|
||||
// Example modals
|
||||
.bd-example-modal {
|
||||
background-color: #f5f5f5;
|
||||
}
|
||||
.bd-example-modal .modal {
|
||||
position: relative;
|
||||
top: auto;
|
||||
right: auto;
|
||||
bottom: auto;
|
||||
left: auto;
|
||||
z-index: 1;
|
||||
display: block;
|
||||
}
|
||||
.bd-example-modal .modal-dialog {
|
||||
left: auto;
|
||||
margin-right: auto;
|
||||
margin-left: auto;
|
||||
background-color: #fafafa;
|
||||
|
||||
.modal {
|
||||
position: relative;
|
||||
top: auto;
|
||||
right: auto;
|
||||
bottom: auto;
|
||||
left: auto;
|
||||
z-index: 1;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.modal-dialog {
|
||||
left: auto;
|
||||
margin-right: auto;
|
||||
margin-left: auto;
|
||||
}
|
||||
}
|
||||
|
||||
// Example dropdowns
|
||||
|
|
@ -308,7 +314,8 @@
|
|||
.bg-info,
|
||||
.bg-warning,
|
||||
.bg-danger,
|
||||
.bg-inverse {
|
||||
.bg-inverse,
|
||||
.bg-faded {
|
||||
&:not(.navbar) {
|
||||
padding: .5rem;
|
||||
margin-top: .5rem;
|
||||
|
|
@ -317,6 +324,16 @@
|
|||
}
|
||||
}
|
||||
|
||||
.bd-example-border-utils {
|
||||
[class^="border-"] {
|
||||
display: inline-block;
|
||||
width: 6rem;
|
||||
height: 6rem;
|
||||
margin: .25rem;
|
||||
background-color: #f5f5f5;
|
||||
border: 1px solid;
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// Code snippets
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
margin-right: -1px;
|
||||
margin-left: -1px;
|
||||
}
|
||||
.bd-featured-sites .col-xs-6 {
|
||||
.bd-featured-sites .col-6 {
|
||||
padding: 1px;
|
||||
}
|
||||
.bd-featured-sites .img-fluid {
|
||||
|
|
|
|||
|
|
@ -1,11 +1,22 @@
|
|||
// scss-lint:disable VendorPrefix
|
||||
|
||||
//
|
||||
// Main navbar
|
||||
//
|
||||
|
||||
.bd-navbar {
|
||||
padding-right: 0;
|
||||
padding-left: 0;
|
||||
margin-bottom: 2rem;
|
||||
// @include media-breakpoint-up(md) {
|
||||
position: -webkit-sticky;
|
||||
position: sticky;
|
||||
top: 0;
|
||||
z-index: 1030; // over everything in bootstrap
|
||||
// max-height: calc(100vh - 4rem);
|
||||
// overflow-y: auto;
|
||||
// }
|
||||
// padding-right: 0;
|
||||
// padding-left: 0;
|
||||
// margin-bottom: 2rem;
|
||||
background-color: #fff;
|
||||
border-bottom: 1px solid rgba(0,0,0,.1);
|
||||
box-shadow: 0 6px 12px rgba(0,0,0,.05);
|
||||
|
||||
|
|
@ -28,16 +39,10 @@
|
|||
}
|
||||
|
||||
.dropdown-menu {
|
||||
font-size: inherit;
|
||||
font-size: .875rem;
|
||||
}
|
||||
|
||||
@include media-breakpoint-down(sm) {
|
||||
.nav-link {
|
||||
float: none;
|
||||
|
||||
+ .nav-link {
|
||||
margin-left: 0;
|
||||
}
|
||||
}
|
||||
.navbar-brand {
|
||||
color: $bd-purple;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@
|
|||
.responsive-utilities-test {
|
||||
margin-top: .25rem;
|
||||
}
|
||||
.responsive-utilities-test .col-xs-6 {
|
||||
.responsive-utilities-test .col-6 {
|
||||
margin-top: .5rem;
|
||||
margin-bottom: .5rem;
|
||||
}
|
||||
|
|
@ -50,7 +50,7 @@
|
|||
}
|
||||
.visible-on,
|
||||
.hidden-on {
|
||||
.col-xs-6 {
|
||||
.col-6 {
|
||||
> .not-visible {
|
||||
color: #999;
|
||||
border: 1px solid #ddd;
|
||||
|
|
@ -59,7 +59,7 @@
|
|||
}
|
||||
.visible-on,
|
||||
.hidden-on {
|
||||
.col-xs-6 {
|
||||
.col-6 {
|
||||
.visible {
|
||||
color: #468847;
|
||||
background-color: #dff0d8;
|
||||
|
|
|
|||
|
|
@ -1,11 +1,14 @@
|
|||
// scss-lint:disable VendorPrefix
|
||||
|
||||
//
|
||||
// Side navigation
|
||||
//
|
||||
|
||||
.bd-sidebar {
|
||||
@include media-breakpoint-up(md) {
|
||||
position: -webkit-sticky;
|
||||
position: sticky;
|
||||
top: 2rem;
|
||||
top: 5rem;
|
||||
max-height: calc(100vh - 4rem);
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,33 +0,0 @@
|
|||
// Bootstrap flexbox grid for our docs page
|
||||
|
||||
|
||||
//
|
||||
// Variables
|
||||
//
|
||||
|
||||
@import "custom";
|
||||
@import "variables";
|
||||
|
||||
// Override for flexbox mode
|
||||
$enable-flex: true;
|
||||
|
||||
//
|
||||
// Grid mixins
|
||||
//
|
||||
|
||||
@import "mixins/clearfix";
|
||||
@import "mixins/breakpoints";
|
||||
@import "mixins/grid-framework";
|
||||
@import "mixins/grid";
|
||||
|
||||
//
|
||||
// Utilities for flex alignment
|
||||
//
|
||||
|
||||
@import "utilities/flex";
|
||||
|
||||
//
|
||||
// Generate the grid class
|
||||
//
|
||||
|
||||
@import "grid";
|
||||
|
|
@ -8,8 +8,6 @@ Bootstrap currently works around several outstanding browser bugs in major brows
|
|||
|
||||
We publicly list browser bugs that are impacting us here, in the hopes of expediting the process of fixing them. For information on Bootstrap's browser compatibility, [see our browser compatibility docs]({{ site.baseurl }}/getting-started/browsers-devices/#supported-browsers).
|
||||
|
||||
Also see [jQuery's browser bug workarounds](https://docs.google.com/document/d/1LPaPA30bLUB_publLIMF0RlhdnPx_ePXm7oW02iiT6o).
|
||||
|
||||
See also:
|
||||
|
||||
* [Chromium issue 536263: [meta] Issues affecting Bootstrap](https://code.google.com/p/chromium/issues/detail?id=536263)
|
||||
|
|
|
|||
|
|
@ -73,12 +73,12 @@ Using the alert JavaScript plugin, it's possible to dismiss any alert inline. He
|
|||
- Be sure you've loaded the alert plugin, or the compiled Bootstrap JavaScript.
|
||||
- Add a dismiss button and the `.alert-dismissible` class, which adds extra padding to the right of the alert and positions the `.close` button.
|
||||
- On the dismiss button, add the `data-dismiss="alert"` attribute, which triggers the JavaScript functionality. Be sure to use the `<button>` element with it for proper behavior across all devices.
|
||||
- To animate alerts when dismissing them, be sure to add the `.fade` and `.in` classes.
|
||||
- To animate alerts when dismissing them, be sure to add the `.fade` and `.show` classes.
|
||||
|
||||
You can see this in action with a live demo:
|
||||
|
||||
{% example html %}
|
||||
<div class="alert alert-warning alert-dismissible fade in" role="alert">
|
||||
<div class="alert alert-warning alert-dismissible fade show" role="alert">
|
||||
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
|
|
@ -111,7 +111,7 @@ Note that closing an alert will remove it from the DOM.
|
|||
| Method | Description |
|
||||
| --- | --- |
|
||||
| `$().alert()` | Makes an alert listen for click events on descendant elements which have the `data-dismiss="alert"` attribute. (Not necessary when using the data-api's auto-initialization.) |
|
||||
| `$().alert('close')` | Closes an alert by removing it from the DOM. If the `.fade` and `.in` classes are present on the element, the alert will fade out before it is removed. |
|
||||
| `$().alert('close')` | Closes an alert by removing it from the DOM. If the `.fade` and `.show` classes are present on the element, the alert will fade out before it is removed. |
|
||||
|
||||
{% highlight js %}$(".alert").alert('close'){% endhighlight %}
|
||||
|
||||
|
|
|
|||
55
docs/components/badge.md
Normal file
55
docs/components/badge.md
Normal file
|
|
@ -0,0 +1,55 @@
|
|||
---
|
||||
layout: docs
|
||||
title: Badges
|
||||
description: Documentation and examples for badges, our small count and labelling component.
|
||||
group: components
|
||||
---
|
||||
|
||||
Small and adaptive tag for adding context to just about any content.
|
||||
|
||||
## Contents
|
||||
|
||||
* Will be replaced with the ToC, excluding the "Contents" header
|
||||
{:toc}
|
||||
|
||||
## Example
|
||||
|
||||
Badges scale to match the size of the immediate parent element by using relative font sizing and `em` units.
|
||||
|
||||
{% example html %}
|
||||
<h1>Example heading <span class="badge badge-default">New</span></h1>
|
||||
<h2>Example heading <span class="badge badge-default">New</span></h2>
|
||||
<h3>Example heading <span class="badge badge-default">New</span></h3>
|
||||
<h4>Example heading <span class="badge badge-default">New</span></h4>
|
||||
<h5>Example heading <span class="badge badge-default">New</span></h5>
|
||||
<h6>Example heading <span class="badge badge-default">New</span></h6>
|
||||
{% endexample %}
|
||||
|
||||
## Contextual variations
|
||||
|
||||
Add any of the below mentioned modifier classes to change the appearance of a badge.
|
||||
|
||||
{% example html %}
|
||||
<span class="badge badge-default">Default</span>
|
||||
<span class="badge badge-primary">Primary</span>
|
||||
<span class="badge badge-success">Success</span>
|
||||
<span class="badge badge-info">Info</span>
|
||||
<span class="badge badge-warning">Warning</span>
|
||||
<span class="badge badge-danger">Danger</span>
|
||||
{% endexample %}
|
||||
|
||||
{% capture callout-include %}{% include callout-warning-color-assistive-technologies.md %}{% endcapture %}
|
||||
{{ callout-include | markdownify }}
|
||||
|
||||
## Pill badges
|
||||
|
||||
Use the `.badge-pill` modifier class to make badges more rounded (with a larger `border-radius` and additional horizontal `padding`). Useful if you miss the badges from v3.
|
||||
|
||||
{% example html %}
|
||||
<span class="badge badge-pill badge-default">Default</span>
|
||||
<span class="badge badge-pill badge-primary">Primary</span>
|
||||
<span class="badge badge-pill badge-success">Success</span>
|
||||
<span class="badge badge-pill badge-info">Info</span>
|
||||
<span class="badge badge-pill badge-warning">Warning</span>
|
||||
<span class="badge badge-pill badge-danger">Danger</span>
|
||||
{% endexample %}
|
||||
|
|
@ -26,17 +26,17 @@ Wrap a series of buttons with `.btn` in `.btn-group`.
|
|||
|
||||
## Button toolbar
|
||||
|
||||
Combine sets of button groups into button toolbars for more complex components.
|
||||
Combine sets of button groups into button toolbars for more complex components. Use utility classes as needed to space out groups, buttons, and more.
|
||||
|
||||
{% example html %}
|
||||
<div class="btn-toolbar" role="toolbar" aria-label="Toolbar with button groups">
|
||||
<div class="btn-group" role="group" aria-label="First group">
|
||||
<div class="btn-group mr-2" role="group" aria-label="First group">
|
||||
<button type="button" class="btn btn-secondary">1</button>
|
||||
<button type="button" class="btn btn-secondary">2</button>
|
||||
<button type="button" class="btn btn-secondary">3</button>
|
||||
<button type="button" class="btn btn-secondary">4</button>
|
||||
</div>
|
||||
<div class="btn-group" role="group" aria-label="Second group">
|
||||
<div class="btn-group mr-2" role="group" aria-label="Second group">
|
||||
<button type="button" class="btn btn-secondary">5</button>
|
||||
<button type="button" class="btn btn-secondary">6</button>
|
||||
<button type="button" class="btn btn-secondary">7</button>
|
||||
|
|
@ -47,6 +47,36 @@ Combine sets of button groups into button toolbars for more complex components.
|
|||
</div>
|
||||
{% endexample %}
|
||||
|
||||
Feel free to mix input groups with button groups in your toolbars. Similar to the example above, you'll likely need some utilities though to space things properly.
|
||||
|
||||
{% example html %}
|
||||
<div class="btn-toolbar mb-3" role="toolbar" aria-label="Toolbar with button groups">
|
||||
<div class="btn-group mr-2" role="group" aria-label="First group">
|
||||
<button type="button" class="btn btn-secondary">1</button>
|
||||
<button type="button" class="btn btn-secondary">2</button>
|
||||
<button type="button" class="btn btn-secondary">3</button>
|
||||
<button type="button" class="btn btn-secondary">4</button>
|
||||
</div>
|
||||
<div class="input-group">
|
||||
<span class="input-group-addon" id="btnGroupAddon">@</span>
|
||||
<input type="text" class="form-control" placeholder="Input group example" aria-describedby="btnGroupAddon">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="btn-toolbar justify-content-between" role="toolbar" aria-label="Toolbar with button groups">
|
||||
<div class="btn-group" role="group" aria-label="First group">
|
||||
<button type="button" class="btn btn-secondary">1</button>
|
||||
<button type="button" class="btn btn-secondary">2</button>
|
||||
<button type="button" class="btn btn-secondary">3</button>
|
||||
<button type="button" class="btn btn-secondary">4</button>
|
||||
</div>
|
||||
<div class="input-group">
|
||||
<span class="input-group-addon" id="btnGroupAddon2">@</span>
|
||||
<input type="text" class="form-control" placeholder="Input group example" aria-describedby="btnGroupAddon2">
|
||||
</div>
|
||||
</div>
|
||||
{% endexample %}
|
||||
|
||||
## Sizing
|
||||
|
||||
Instead of applying button sizing classes to every button in a group, just add `.btn-group-*` to each `.btn-group`, including each one when nesting multiple groups.
|
||||
|
|
@ -102,6 +132,18 @@ Place a `.btn-group` within another `.btn-group` when you want dropdown menus mi
|
|||
|
||||
Make a set of buttons appear vertically stacked rather than horizontally. **Split button dropdowns are not supported here.**
|
||||
|
||||
<div class="bd-example">
|
||||
<div class="btn-group-vertical" role="group" aria-label="Vertical button group">
|
||||
<button type="button" class="btn btn-secondary">Button</button>
|
||||
<button type="button" class="btn btn-secondary">Button</button>
|
||||
<button type="button" class="btn btn-secondary">Button</button>
|
||||
<button type="button" class="btn btn-secondary">Button</button>
|
||||
<button type="button" class="btn btn-secondary">Button</button>
|
||||
<button type="button" class="btn btn-secondary">Button</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="bd-example">
|
||||
<div class="btn-group-vertical" role="group" aria-label="Vertical button group">
|
||||
<button type="button" class="btn btn-secondary">Button</button>
|
||||
|
|
|
|||
|
|
@ -105,10 +105,6 @@ Buttons will appear pressed (with a darker background, darker border, and inset
|
|||
|
||||
Make buttons look inactive by adding the `disabled` boolean attribute to any `<button>` element.
|
||||
|
||||
{% callout info %}
|
||||
**Heads up!** IE9 and below render disabled buttons with gray, shadowed text that we can't override.
|
||||
{% endcallout %}
|
||||
|
||||
{% example html %}
|
||||
<button type="button" class="btn btn-lg btn-primary" disabled>Primary button</button>
|
||||
<button type="button" class="btn btn-secondary btn-lg" disabled>Button</button>
|
||||
|
|
|
|||
|
|
@ -16,10 +16,12 @@ If you're familiar with Bootstrap 3, cards replace our old panels, wells, and th
|
|||
|
||||
## Example
|
||||
|
||||
Cards require a small amount of markup and classes to provide you with as much control as possible. These classes and markup are flexible though and can typically be remixed and extended with ease. For example, if your card has no flush content like images, feel free to put the `.card-block` class on the `.card` element to consolidate your markup.
|
||||
Cards are built with as little markup and styles as possible, but still manage to deliver a ton of control and customization. Built with flexbox, they offer easy alignment and mix well with other Bootstrap components.
|
||||
|
||||
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 it's parent element. This is easily customized with our various [sizing options](#sizing).
|
||||
|
||||
{% example html %}
|
||||
<div class="card">
|
||||
<div class="card" style="width: 20rem;">
|
||||
<img class="card-img-top" data-src="holder.js/100px180/" alt="Card image cap">
|
||||
<div class="card-block">
|
||||
<h4 class="card-title">Card title</h4>
|
||||
|
|
@ -31,38 +33,39 @@ Cards require a small amount of markup and classes to provide you with as much c
|
|||
|
||||
## Content types
|
||||
|
||||
Cards support a wide variety of content, including images, text, list groups, links, and more. Mix and match multiple content types to create the card you need.
|
||||
Cards support a wide variety of content, including images, text, list groups, links, and more. Below are examples of what's supported.
|
||||
|
||||
### Blocks
|
||||
|
||||
The building block of a card is the `.card-block`. Use it whenever you need a padded section within a card.
|
||||
|
||||
{% example html %}
|
||||
<div class="card">
|
||||
<div class="card-block">
|
||||
This is some text within a card block.
|
||||
</div>
|
||||
</div>
|
||||
{% endexample %}
|
||||
|
||||
### Titles, text, and links
|
||||
|
||||
Card titles are used by adding `.card-title` to a `<h*>` tag. In the same way, links are added and placed next to each other by adding `.card-link` to a `<a>` tag.
|
||||
|
||||
Subtitles are used by adding a `.card-subtitle` to an `<h*>` tag. If the `.card-title` and the `.card-subtitle` items are placed in a `.card-block` item, the card title and subtitle are aligned nicely.
|
||||
|
||||
{% example html %}
|
||||
<div class="card">
|
||||
<img class="card-img-top" data-src="holder.js/100px180/?text=Image cap" alt="Card image cap">
|
||||
<div class="card-block">
|
||||
<h4 class="card-title">Card title</h4>
|
||||
<h6 class="card-subtitle mb-2 text-muted">Card subtitle</h6>
|
||||
<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>
|
||||
</div>
|
||||
<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>
|
||||
<li class="list-group-item">Vestibulum at eros</li>
|
||||
</ul>
|
||||
<div class="card-block">
|
||||
<a href="#" class="card-link">Card link</a>
|
||||
<a href="#" class="card-link">Another link</a>
|
||||
</div>
|
||||
</div>
|
||||
{% endexample %}
|
||||
|
||||
Lists can be added to a card by adding a list group.
|
||||
|
||||
{% example html %}
|
||||
<div class="card">
|
||||
<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>
|
||||
<li class="list-group-item">Vestibulum at eros</li>
|
||||
</ul>
|
||||
</div>
|
||||
{% endexample %}
|
||||
### Images
|
||||
|
||||
`.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.
|
||||
|
||||
|
|
@ -75,96 +78,44 @@ Lists can be added to a card by adding a list group.
|
|||
</div>
|
||||
{% endexample %}
|
||||
|
||||
Card titles are used by adding `.card-title` to a `<h*>` tag. In the same way, links are added and placed next to each other by adding `.card-link` to a `<a>` tag.
|
||||
### List groups
|
||||
|
||||
{% example html %}
|
||||
<div class="card card-block">
|
||||
<h4 class="card-title">Card title</h4>
|
||||
<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>
|
||||
<a href="#" class="card-link">Card link</a>
|
||||
<a href="#" class="card-link">Another link</a>
|
||||
</div>
|
||||
{% endexample %}
|
||||
|
||||
Subtitles are used by adding a `.card-subtitle` to an `<h*>` tag. If the `.card-title` and the `.card-subtitle` items are placed in a `.card-block` item, the card title and subtitle are aligned nicely.
|
||||
|
||||
The multiple content types can be easily combined to create the card you need. See below for an example.
|
||||
Create lists of content in a card with a flush list group.
|
||||
|
||||
{% example html %}
|
||||
<div class="card">
|
||||
<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>
|
||||
<li class="list-group-item">Vestibulum at eros</li>
|
||||
</ul>
|
||||
</div>
|
||||
{% endexample %}
|
||||
|
||||
### Kitchen sink
|
||||
|
||||
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;">
|
||||
<img class="card-img-top" data-src="holder.js/100px180/?text=Image cap" alt="Card image cap">
|
||||
<div class="card-block">
|
||||
<h4 class="card-title">Card title</h4>
|
||||
<h6 class="card-subtitle text-muted">Support card subtitle</h6>
|
||||
</div>
|
||||
<img data-src="holder.js/100px180/?text=Image" alt="Card image">
|
||||
<div class="card-block">
|
||||
<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>
|
||||
</div>
|
||||
<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>
|
||||
<li class="list-group-item">Vestibulum at eros</li>
|
||||
</ul>
|
||||
<div class="card-block">
|
||||
<a href="#" class="card-link">Card link</a>
|
||||
<a href="#" class="card-link">Another link</a>
|
||||
</div>
|
||||
</div>
|
||||
{% endexample %}
|
||||
|
||||
## Sizing
|
||||
|
||||
Constrain the width of cards via custom CSS, our predefined grid classes, or with custom styles using our grid mixins.
|
||||
|
||||
Using the grid:
|
||||
|
||||
{% example html %}
|
||||
<div class="row">
|
||||
<div class="col-sm-6">
|
||||
<div class="card card-block">
|
||||
<h3 class="card-title">Special title treatment</h3>
|
||||
<p class="card-text">With supporting text below as a natural lead-in to additional content.</p>
|
||||
<a href="#" class="btn btn-primary">Go somewhere</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-6">
|
||||
<div class="card card-block">
|
||||
<h3 class="card-title">Special title treatment</h3>
|
||||
<p class="card-text">With supporting text below as a natural lead-in to additional content.</p>
|
||||
<a href="#" class="btn btn-primary">Go somewhere</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endexample %}
|
||||
|
||||
Using custom widths:
|
||||
|
||||
{% example html %}
|
||||
<div class="card card-block" style="width: 18rem;">
|
||||
<h3 class="card-title">Special title treatment</h3>
|
||||
<p class="card-text">With supporting text below as a natural lead-in to additional content.</p>
|
||||
<a href="#" class="btn btn-primary">Go somewhere</a>
|
||||
</div>
|
||||
{% endexample %}
|
||||
|
||||
## Text alignment
|
||||
|
||||
You can quickly change the text alignment of any card—in its entirety or specific parts—with our [text align classes]({{ site.baseurl }}/utilities/typography/#text-alignment).
|
||||
|
||||
{% example html %}
|
||||
<div class="card card-block">
|
||||
<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>
|
||||
<a href="#" class="btn btn-primary">Go somewhere</a>
|
||||
</div>
|
||||
|
||||
<div class="card card-block text-xs-center">
|
||||
<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>
|
||||
<a href="#" class="btn btn-primary">Go somewhere</a>
|
||||
</div>
|
||||
|
||||
<div class="card card-block text-xs-right">
|
||||
<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>
|
||||
<a href="#" class="btn btn-primary">Go somewhere</a>
|
||||
</div>
|
||||
{% endexample %}
|
||||
|
||||
## Header and footer
|
||||
### Header and footer
|
||||
|
||||
Add an optional header and/or footer within a card.
|
||||
|
||||
|
|
@ -209,7 +160,7 @@ Card headers can be styled by adding `.card-header` to `<h*>` elements.
|
|||
{% endexample %}
|
||||
|
||||
{% example html %}
|
||||
<div class="card text-xs-center">
|
||||
<div class="card text-center">
|
||||
<div class="card-header">
|
||||
Featured
|
||||
</div>
|
||||
|
|
@ -224,14 +175,111 @@ Card headers can be styled by adding `.card-header` to `<h*>` elements.
|
|||
</div>
|
||||
{% endexample %}
|
||||
|
||||
## Header nav
|
||||
## Sizing
|
||||
|
||||
Use Bootstrap's nav pills or tabs within a card header. Be sure to always include a `.pull-*-*` utility class for proper alignment.
|
||||
Cards assume no specific `width` to start, so they'll be 100% wide unless otherwise stated. You can change this as needed with custom CSS, grid classes, grid Sass mixins, or utilities.
|
||||
|
||||
### Using grid markup
|
||||
|
||||
Using the grid, wrap cards in columns and rows as needed.
|
||||
|
||||
{% example html %}
|
||||
<div class="card text-xs-center">
|
||||
<div class="row">
|
||||
<div class="col-sm-6">
|
||||
<div class="card">
|
||||
<div class="card-block">
|
||||
<h3 class="card-title">Special title treatment</h3>
|
||||
<p class="card-text">With supporting text below as a natural lead-in to additional content.</p>
|
||||
<a href="#" class="btn btn-primary">Go somewhere</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-6">
|
||||
<div class="card">
|
||||
<div class="card-block">
|
||||
<h3 class="card-title">Special title treatment</h3>
|
||||
<p class="card-text">With supporting text below as a natural lead-in to additional content.</p>
|
||||
<a href="#" class="btn btn-primary">Go somewhere</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endexample %}
|
||||
|
||||
### Using utilities
|
||||
|
||||
Use our handful of [available sizing utilities]({{ site.baseurl }}/utilities/sizing-and-positioning/#width-and-height) to quickly set a card's width.
|
||||
|
||||
{% example html %}
|
||||
<div class="card w-75">
|
||||
<div class="card-block">
|
||||
<h3 class="card-title">Card title</h3>
|
||||
<p class="card-text">With supporting text below as a natural lead-in to additional content.</p>
|
||||
<a href="#" class="btn btn-primary">Button</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card w-50">
|
||||
<div class="card-block">
|
||||
<h3 class="card-title">Card title</h3>
|
||||
<p class="card-text">With supporting text below as a natural lead-in to additional content.</p>
|
||||
<a href="#" class="btn btn-primary">Button</a>
|
||||
</div>
|
||||
</div>
|
||||
{% endexample %}
|
||||
|
||||
### Using custom CSS
|
||||
|
||||
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-block">
|
||||
<h3 class="card-title">Special title treatment</h3>
|
||||
<p class="card-text">With supporting text below as a natural lead-in to additional content.</p>
|
||||
<a href="#" class="btn btn-primary">Go somewhere</a>
|
||||
</div>
|
||||
</div>
|
||||
{% endexample %}
|
||||
|
||||
## Text alignment
|
||||
|
||||
You can quickly change the text alignment of any card—in its entirety or specific parts—with our [text align classes]({{ site.baseurl }}/utilities/typography/#text-alignment).
|
||||
|
||||
{% example html %}
|
||||
<div class="card" style="width: 20rem;">
|
||||
<div class="card-block">
|
||||
<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>
|
||||
<a href="#" class="btn btn-primary">Go somewhere</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card text-center" style="width: 20rem;">
|
||||
<div class="card-block">
|
||||
<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>
|
||||
<a href="#" class="btn btn-primary">Go somewhere</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card text-right" style="width: 20rem;">
|
||||
<div class="card-block">
|
||||
<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>
|
||||
<a href="#" class="btn btn-primary">Go somewhere</a>
|
||||
</div>
|
||||
</div>
|
||||
{% endexample %}
|
||||
|
||||
## Navigation
|
||||
|
||||
Add some navigation to a card's header (or block) with Bootstrap's [nav components]({{ site.baseurl }}/components/navs/).
|
||||
|
||||
{% example html %}
|
||||
<div class="card text-center">
|
||||
<div class="card-header">
|
||||
<ul class="nav nav-tabs card-header-tabs float-xs-left">
|
||||
<ul class="nav nav-tabs card-header-tabs">
|
||||
<li class="nav-item">
|
||||
<a class="nav-link active" href="#">Active</a>
|
||||
</li>
|
||||
|
|
@ -252,9 +300,9 @@ Use Bootstrap's nav pills or tabs within a card header. Be sure to always includ
|
|||
{% endexample %}
|
||||
|
||||
{% example html %}
|
||||
<div class="card text-xs-center">
|
||||
<div class="card text-center">
|
||||
<div class="card-header">
|
||||
<ul class="nav nav-pills card-header-pills float-xs-left">
|
||||
<ul class="nav nav-pills card-header-pills">
|
||||
<li class="nav-item">
|
||||
<a class="nav-link active" href="#">Active</a>
|
||||
</li>
|
||||
|
|
@ -274,12 +322,16 @@ Use Bootstrap's nav pills or tabs within a card header. Be sure to always includ
|
|||
</div>
|
||||
{% endexample %}
|
||||
|
||||
## Image caps
|
||||
## Images
|
||||
|
||||
Similar to headers and footers, cards include top and bottom image caps.
|
||||
Cards include a few options for working with images. Choose from appending "image caps" at either end of a card, overlaying images with card content, or simply embedding the image in a card.
|
||||
|
||||
### Image caps
|
||||
|
||||
Similar to headers and footers, cards can include top and bottom "image caps"—images at the top or bottom of a card.
|
||||
|
||||
{% example html %}
|
||||
<div class="card">
|
||||
<div class="card mb-3">
|
||||
<img class="card-img-top" data-src="holder.js/100px180/" alt="Card image cap">
|
||||
<div class="card-block">
|
||||
<h4 class="card-title">Card title</h4>
|
||||
|
|
@ -297,7 +349,7 @@ Similar to headers and footers, cards include top and bottom image caps.
|
|||
</div>
|
||||
{% endexample %}
|
||||
|
||||
## Image overlays
|
||||
### Image overlays
|
||||
|
||||
Turn an image into a card background and overlay your card's text. Depending on the image, you may or may not need `.card-inverse` (see below).
|
||||
|
||||
|
|
@ -312,9 +364,13 @@ Turn an image into a card background and overlay your card's text. Depending on
|
|||
</div>
|
||||
{% endexample %}
|
||||
|
||||
## Inverted text
|
||||
## Card styles
|
||||
|
||||
Cards include a class for quickly toggling **the text color**. By default, cards use dark text and assume a light background. **Add `.card-inverse` for white text** and specify the `background-color` and `border-color` to go with it.
|
||||
Cards include various options for customizing their backgrounds, borders, and color.
|
||||
|
||||
### Inverted text
|
||||
|
||||
By default, cards use dark text and assume a light background. You can reverse that by toggling the `color` of text within, as well as that of the card's subcomponents, with `.card-inverse`. Then, specify a dark `background-color` and `border-color` to go with it.
|
||||
|
||||
You can also use `.card-inverse` with the [contextual backgrounds variants](#background-variants).
|
||||
|
||||
|
|
@ -328,12 +384,12 @@ You can also use `.card-inverse` with the [contextual backgrounds variants](#bac
|
|||
</div>
|
||||
{% endexample %}
|
||||
|
||||
## Background variants
|
||||
### Background variants
|
||||
|
||||
Cards include their own variant classes for quickly changing the `background-color` and `border-color` of a card. **Darker colors require the use of `.card-inverse`.**
|
||||
|
||||
{% example html %}
|
||||
<div class="card card-inverse card-primary text-xs-center">
|
||||
<div class="card card-inverse card-primary mb-3 text-center">
|
||||
<div class="card-block">
|
||||
<blockquote class="card-blockquote">
|
||||
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.</p>
|
||||
|
|
@ -341,7 +397,7 @@ Cards include their own variant classes for quickly changing the `background-col
|
|||
</blockquote>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card card-inverse card-success text-xs-center">
|
||||
<div class="card card-inverse card-success mb-3 text-center">
|
||||
<div class="card-block">
|
||||
<blockquote class="card-blockquote">
|
||||
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.</p>
|
||||
|
|
@ -349,7 +405,7 @@ Cards include their own variant classes for quickly changing the `background-col
|
|||
</blockquote>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card card-inverse card-info text-xs-center">
|
||||
<div class="card card-inverse card-info mb-3 text-center">
|
||||
<div class="card-block">
|
||||
<blockquote class="card-blockquote">
|
||||
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.</p>
|
||||
|
|
@ -357,7 +413,7 @@ Cards include their own variant classes for quickly changing the `background-col
|
|||
</blockquote>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card card-inverse card-warning text-xs-center">
|
||||
<div class="card card-inverse card-warning mb-3 text-center">
|
||||
<div class="card-block">
|
||||
<blockquote class="card-blockquote">
|
||||
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.</p>
|
||||
|
|
@ -365,7 +421,7 @@ Cards include their own variant classes for quickly changing the `background-col
|
|||
</blockquote>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card card-inverse card-danger text-xs-center">
|
||||
<div class="card card-inverse card-danger text-center">
|
||||
<div class="card-block">
|
||||
<blockquote class="card-blockquote">
|
||||
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.</p>
|
||||
|
|
@ -378,12 +434,12 @@ Cards include their own variant classes for quickly changing the `background-col
|
|||
{% capture callout-include %}{% include callout-warning-color-assistive-technologies.md %}{% endcapture %}
|
||||
{{ callout-include | markdownify }}
|
||||
|
||||
## Outline variants
|
||||
### Outline cards
|
||||
|
||||
In need of a colored card, but not the hefty background colors they bring? Replace the default modifier classes with the `.card-outline-*` ones to style just the `border-color` of a card.
|
||||
|
||||
{% example html %}
|
||||
<div class="card card-outline-primary text-xs-center">
|
||||
<div class="card card-outline-primary mb-3 text-center">
|
||||
<div class="card-block">
|
||||
<blockquote class="card-blockquote">
|
||||
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.</p>
|
||||
|
|
@ -391,7 +447,7 @@ In need of a colored card, but not the hefty background colors they bring? Repla
|
|||
</blockquote>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card card-outline-secondary text-xs-center">
|
||||
<div class="card card-outline-secondary mb-3 text-center">
|
||||
<div class="card-block">
|
||||
<blockquote class="card-blockquote">
|
||||
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.</p>
|
||||
|
|
@ -399,7 +455,7 @@ In need of a colored card, but not the hefty background colors they bring? Repla
|
|||
</blockquote>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card card-outline-success text-xs-center">
|
||||
<div class="card card-outline-success mb-3 text-center">
|
||||
<div class="card-block">
|
||||
<blockquote class="card-blockquote">
|
||||
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.</p>
|
||||
|
|
@ -407,7 +463,7 @@ In need of a colored card, but not the hefty background colors they bring? Repla
|
|||
</blockquote>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card card-outline-info text-xs-center">
|
||||
<div class="card card-outline-info mb-3 text-center">
|
||||
<div class="card-block">
|
||||
<blockquote class="card-blockquote">
|
||||
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.</p>
|
||||
|
|
@ -415,7 +471,7 @@ In need of a colored card, but not the hefty background colors they bring? Repla
|
|||
</blockquote>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card card-outline-warning text-xs-center">
|
||||
<div class="card card-outline-warning mb-3 text-center">
|
||||
<div class="card-block">
|
||||
<blockquote class="card-blockquote">
|
||||
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.</p>
|
||||
|
|
@ -423,7 +479,7 @@ In need of a colored card, but not the hefty background colors they bring? Repla
|
|||
</blockquote>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card card-outline-danger text-xs-center">
|
||||
<div class="card card-outline-danger text-center">
|
||||
<div class="card-block">
|
||||
<blockquote class="card-blockquote">
|
||||
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.</p>
|
||||
|
|
@ -433,11 +489,13 @@ In need of a colored card, but not the hefty background colors they bring? Repla
|
|||
</div>
|
||||
{% endexample %}
|
||||
|
||||
## Groups
|
||||
## Card layout
|
||||
|
||||
Use card groups to render cards as a single, attached element with equal width and height columns. By default, card groups use `display: table;` and `table-layout: fixed;` to achieve their uniform sizing. However, enabling [flexbox mode]({{ site.baseurl }}/getting-started/flexbox/) can switch that to use `display: flex;` and provide the same effect.
|
||||
In addition to styling the content within cards, Bootstrap includes a few options for laying out series of cards. For the time being, **these layout options are not yet responsive**.
|
||||
|
||||
Only applies to small devices and above.
|
||||
### Card groups
|
||||
|
||||
Use card groups to render cards as a single, attached element with equal width and height columns. Card groups use `display: flex;` to achieve their uniform sizing.
|
||||
|
||||
{% example html %}
|
||||
<div class="card-group">
|
||||
|
|
@ -468,52 +526,118 @@ Only applies to small devices and above.
|
|||
</div>
|
||||
{% endexample %}
|
||||
|
||||
## Decks
|
||||
|
||||
Need a set of equal width and height cards that aren't attached to one another? Use card decks. By default, card decks require two wrapping elements: `.card-deck-wrapper` and a `.card-deck`. We use table styles for the sizing and the gutters on `.card-deck`. The `.card-deck-wrapper` is used to negative margin out the `border-spacing` on the `.card-deck`.
|
||||
|
||||
Only applies to small devices and above.
|
||||
|
||||
**ProTip!** If you enable [flexbox mode]({{ site.baseurl }}/getting-started/flexbox/), you can remove the `.card-deck-wrapper`.
|
||||
When using card groups with footers, their content will automatically line up.
|
||||
|
||||
{% example html %}
|
||||
<div class="card-deck-wrapper">
|
||||
<div class="card-deck">
|
||||
<div class="card">
|
||||
<img class="card-img-top" data-src="holder.js/100px200/" alt="Card image cap">
|
||||
<div class="card-block">
|
||||
<h4 class="card-title">Card title</h4>
|
||||
<p class="card-text">This is a longer card with supporting text below as a natural lead-in to additional content. This content is a little bit longer.</p>
|
||||
<p class="card-text"><small class="text-muted">Last updated 3 mins ago</small></p>
|
||||
</div>
|
||||
<div class="card-group">
|
||||
<div class="card">
|
||||
<img class="card-img-top" data-src="holder.js/100px180/" alt="Card image cap">
|
||||
<div class="card-block">
|
||||
<h4 class="card-title">Card title</h4>
|
||||
<p class="card-text">This is a wider card with supporting text below as a natural lead-in to additional content. This content is a little bit longer.</p>
|
||||
</div>
|
||||
<div class="card">
|
||||
<img class="card-img-top" data-src="holder.js/100px200/" alt="Card image cap">
|
||||
<div class="card-block">
|
||||
<h4 class="card-title">Card title</h4>
|
||||
<p class="card-text">This card has supporting text below as a natural lead-in to additional content.</p>
|
||||
<p class="card-text"><small class="text-muted">Last updated 3 mins ago</small></p>
|
||||
</div>
|
||||
<div class="card-footer">
|
||||
<small class="text-muted">Last updated 3 mins ago</small>
|
||||
</div>
|
||||
<div class="card">
|
||||
<img class="card-img-top" data-src="holder.js/100px200/" alt="Card image cap">
|
||||
<div class="card-block">
|
||||
<h4 class="card-title">Card title</h4>
|
||||
<p class="card-text">This is a wider card with supporting text below as a natural lead-in to additional content. This card has even longer content than the first to show that equal height action.</p>
|
||||
<p class="card-text"><small class="text-muted">Last updated 3 mins ago</small></p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<img class="card-img-top" data-src="holder.js/100px180/" alt="Card image cap">
|
||||
<div class="card-block">
|
||||
<h4 class="card-title">Card title</h4>
|
||||
<p class="card-text">This card has supporting text below as a natural lead-in to additional content.</p>
|
||||
</div>
|
||||
<div class="card-footer">
|
||||
<small class="text-muted">Last updated 3 mins ago</small>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<img class="card-img-top" data-src="holder.js/100px180/" alt="Card image cap">
|
||||
<div class="card-block">
|
||||
<h4 class="card-title">Card title</h4>
|
||||
<p class="card-text">This is a wider card with supporting text below as a natural lead-in to additional content. This card has even longer content than the first to show that equal height action.</p>
|
||||
</div>
|
||||
<div class="card-footer">
|
||||
<small class="text-muted">Last updated 3 mins ago</small>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endexample %}
|
||||
|
||||
## Columns
|
||||
### Card decks
|
||||
|
||||
Cards can be organized into [Masonry](http://masonry.desandro.com)-like columns with just CSS by wrapping them in `.card-columns`. Cards are ordered from top to bottom and left to right when wrapped in `.card-columns`.
|
||||
Need a set of equal width and height cards that aren't attached to one another? Use card decks. By default, card decks require two wrapping elements: `.card-deck-wrapper` and a `.card-deck`. We use table styles for the sizing and the gutters on `.card-deck`. The `.card-deck-wrapper` is used to negative margin out the `border-spacing` on the `.card-deck`.
|
||||
|
||||
Only applies to small devices and above.
|
||||
{% example html %}
|
||||
<div class="card-deck">
|
||||
<div class="card">
|
||||
<img class="card-img-top" data-src="holder.js/100px200/" alt="Card image cap">
|
||||
<div class="card-block">
|
||||
<h4 class="card-title">Card title</h4>
|
||||
<p class="card-text">This is a longer card with supporting text below as a natural lead-in to additional content. This content is a little bit longer.</p>
|
||||
<p class="card-text"><small class="text-muted">Last updated 3 mins ago</small></p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<img class="card-img-top" data-src="holder.js/100px200/" alt="Card image cap">
|
||||
<div class="card-block">
|
||||
<h4 class="card-title">Card title</h4>
|
||||
<p class="card-text">This card has supporting text below as a natural lead-in to additional content.</p>
|
||||
<p class="card-text"><small class="text-muted">Last updated 3 mins ago</small></p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<img class="card-img-top" data-src="holder.js/100px200/" alt="Card image cap">
|
||||
<div class="card-block">
|
||||
<h4 class="card-title">Card title</h4>
|
||||
<p class="card-text">This is a wider card with supporting text below as a natural lead-in to additional content. This card has even longer content than the first to show that equal height action.</p>
|
||||
<p class="card-text"><small class="text-muted">Last updated 3 mins ago</small></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endexample %}
|
||||
|
||||
**Heads up!** This is **not available in IE9 and below** as they have no support for the [`column-*` CSS properties](https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Using_multi-column_layouts).
|
||||
Just like with card groups, card footers in decks will automatically line up.
|
||||
|
||||
{% example html %}
|
||||
<div class="card-deck">
|
||||
<div class="card">
|
||||
<img class="card-img-top" data-src="holder.js/100px180/" alt="Card image cap">
|
||||
<div class="card-block">
|
||||
<h4 class="card-title">Card title</h4>
|
||||
<p class="card-text">This is a wider card with supporting text below as a natural lead-in to additional content. This content is a little bit longer.</p>
|
||||
</div>
|
||||
<div class="card-footer">
|
||||
<small class="text-muted">Last updated 3 mins ago</small>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<img class="card-img-top" data-src="holder.js/100px180/" alt="Card image cap">
|
||||
<div class="card-block">
|
||||
<h4 class="card-title">Card title</h4>
|
||||
<p class="card-text">This card has supporting text below as a natural lead-in to additional content.</p>
|
||||
</div>
|
||||
<div class="card-footer">
|
||||
<small class="text-muted">Last updated 3 mins ago</small>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<img class="card-img-top" data-src="holder.js/100px180/" alt="Card image cap">
|
||||
<div class="card-block">
|
||||
<h4 class="card-title">Card title</h4>
|
||||
<p class="card-text">This is a wider card with supporting text below as a natural lead-in to additional content. This card has even longer content than the first to show that equal height action.</p>
|
||||
</div>
|
||||
<div class="card-footer">
|
||||
<small class="text-muted">Last updated 3 mins ago</small>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endexample %}
|
||||
|
||||
### Card columns
|
||||
|
||||
Cards can be organized into [Masonry](http://masonry.desandro.com)-like columns with just CSS by wrapping them in `.card-columns`. Cards are built with CSS `column` properties instead of flexbox for easier alignment. Cards are ordered from top to bottom and left to right.
|
||||
|
||||
**Heads up!** Your mileage with card columns may vary. To prevent cards breaking across columns, we must set them to `display: inline-block` as `column-break-inside: avoid` isn't a bulletproof solution yet.
|
||||
|
||||
{% example html %}
|
||||
<div class="card-columns">
|
||||
|
|
@ -524,8 +648,8 @@ Only applies to small devices and above.
|
|||
<p class="card-text">This is a longer card with supporting text below as a natural lead-in to additional content. This content is a little bit longer.</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card card-block">
|
||||
<blockquote class="card-blockquote">
|
||||
<div class="card p-3">
|
||||
<blockquote class="card-block card-blockquote">
|
||||
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.</p>
|
||||
<footer>
|
||||
<small class="text-muted">
|
||||
|
|
@ -542,7 +666,7 @@ Only applies to small devices and above.
|
|||
<p class="card-text"><small class="text-muted">Last updated 3 mins ago</small></p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card card-block card-inverse card-primary text-xs-center">
|
||||
<div class="card card-inverse card-primary p-3 text-center">
|
||||
<blockquote class="card-blockquote">
|
||||
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat.</p>
|
||||
<footer>
|
||||
|
|
@ -552,15 +676,17 @@ Only applies to small devices and above.
|
|||
</footer>
|
||||
</blockquote>
|
||||
</div>
|
||||
<div class="card card-block text-xs-center">
|
||||
<h4 class="card-title">Card title</h4>
|
||||
<p class="card-text">This card has supporting text below as a natural lead-in to additional content.</p>
|
||||
<p class="card-text"><small class="text-muted">Last updated 3 mins ago</small></p>
|
||||
<div class="card text-center">
|
||||
<div class="card-block">
|
||||
<h4 class="card-title">Card title</h4>
|
||||
<p class="card-text">This card has supporting text below as a natural lead-in to additional content.</p>
|
||||
<p class="card-text"><small class="text-muted">Last updated 3 mins ago</small></p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<img class="card-img img-fluid" data-src="holder.js/100px260/" alt="Card image">
|
||||
</div>
|
||||
<div class="card card-block text-xs-right">
|
||||
<div class="card p-3 text-right">
|
||||
<blockquote class="card-blockquote">
|
||||
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.</p>
|
||||
<footer>
|
||||
|
|
@ -570,10 +696,12 @@ Only applies to small devices and above.
|
|||
</footer>
|
||||
</blockquote>
|
||||
</div>
|
||||
<div class="card card-block">
|
||||
<h4 class="card-title">Card title</h4>
|
||||
<p class="card-text">This is a wider card with supporting text below as a natural lead-in to additional content. This card has even longer content than the first to show that equal height action.</p>
|
||||
<p class="card-text"><small class="text-muted">Last updated 3 mins ago</small></p>
|
||||
<div class="card">
|
||||
<div class="card-block">
|
||||
<h4 class="card-title">Card title</h4>
|
||||
<p class="card-text">This is a wider card with supporting text below as a natural lead-in to additional content. This card has even longer content than the first to show that equal height action.</p>
|
||||
<p class="card-text"><small class="text-muted">Last updated 3 mins ago</small></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endexample %}
|
||||
|
|
|
|||
|
|
@ -5,7 +5,11 @@ description: A slideshow component for cycling through elements—images or slid
|
|||
group: components
|
||||
---
|
||||
|
||||
A slideshow component for cycling through elements—images or slides of text—like a carousel. In browsers where the [Page Visibility API](https://www.w3.org/TR/page-visibility/) is supported, the carousel will avoid sliding when the webpage is not visible to the user (such as when the browser tab is inactive, the browser window is minimized, etc.). **Nested carousels are not supported.**
|
||||
The carousel is a slideshow for cycling through a series of content, built with CSS 3D transforms and a bit of JavaScript. It works with a series of images, text, or custom markup. It also includes support for previous/next controls and indicators.
|
||||
|
||||
In browsers where the [Page Visibility API](https://www.w3.org/TR/page-visibility/) is supported, the carousel will avoid sliding when the webpage is not visible to the user (such as when the browser tab is inactive, the browser window is minimized, etc.).
|
||||
|
||||
Please be aware that nested carousels are not supported, and carousels are generally not compliant with accessibility standards.
|
||||
|
||||
## Contents
|
||||
|
||||
|
|
@ -14,30 +18,86 @@ A slideshow component for cycling through elements—images or slides of text—
|
|||
|
||||
## Example
|
||||
|
||||
Carousels don't automatically normalize slide dimensions. As such, you may need to use additional utilities or custom styles to appropriately size content. While carousels support previous/next controls and indicators, they're not explicitly required. Add and customize as you see fit.
|
||||
|
||||
Be sure to set a unique id on the `.carousel` for optional controls, especially if you're using multiple carousels on a single page.
|
||||
|
||||
### Slides only
|
||||
|
||||
Here's a carousel with slides only. Note the presence of the `.d-block` and `.img-fluid` on carousel images to prevent browser default image alignment.
|
||||
|
||||
{% example html %}
|
||||
<div id="carousel-example-generic" class="carousel slide" data-ride="carousel">
|
||||
<div id="carouselExampleSlidesOnly" class="carousel slide" data-ride="carousel">
|
||||
<div class="carousel-inner" role="listbox">
|
||||
<div class="carousel-item active">
|
||||
<img class="d-block img-fluid" data-src="holder.js/800x400?auto=yes&bg=777&fg=555&text=First slide" alt="First slide">
|
||||
</div>
|
||||
<div class="carousel-item">
|
||||
<img class="d-block img-fluid" data-src="holder.js/800x400?auto=yes&bg=666&fg=444&text=Second slide" alt="Second slide">
|
||||
</div>
|
||||
<div class="carousel-item">
|
||||
<img class="d-block img-fluid" data-src="holder.js/800x400?auto=yes&bg=555&fg=333&text=Third slide" alt="Third slide">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endexample %}
|
||||
|
||||
### With controls
|
||||
|
||||
Adding in the previous and next controls:
|
||||
|
||||
{% example html %}
|
||||
<div id="carouselExampleControls" class="carousel slide" data-ride="carousel">
|
||||
<div class="carousel-inner" role="listbox">
|
||||
<div class="carousel-item active">
|
||||
<img class="d-block img-fluid" data-src="holder.js/800x400?auto=yes&bg=777&fg=555&text=First slide" alt="First slide">
|
||||
</div>
|
||||
<div class="carousel-item">
|
||||
<img class="d-block img-fluid" data-src="holder.js/800x400?auto=yes&bg=666&fg=444&text=Second slide" alt="Second slide">
|
||||
</div>
|
||||
<div class="carousel-item">
|
||||
<img class="d-block img-fluid" data-src="holder.js/800x400?auto=yes&bg=555&fg=333&text=Third slide" alt="Third slide">
|
||||
</div>
|
||||
</div>
|
||||
<a class="carousel-control-prev" href="#carouselExampleControls" role="button" data-slide="prev">
|
||||
<span class="carousel-control-prev-icon" aria-hidden="true"></span>
|
||||
<span class="sr-only">Previous</span>
|
||||
</a>
|
||||
<a class="carousel-control-next" href="#carouselExampleControls" role="button" data-slide="next">
|
||||
<span class="carousel-control-next-icon" aria-hidden="true"></span>
|
||||
<span class="sr-only">Next</span>
|
||||
</a>
|
||||
</div>
|
||||
{% endexample %}
|
||||
|
||||
### With indicators
|
||||
|
||||
You can also add the indicators to the carousel, alongside the controls, too.
|
||||
|
||||
{% example html %}
|
||||
<div id="carouselExampleIndicators" class="carousel slide" data-ride="carousel">
|
||||
<ol class="carousel-indicators">
|
||||
<li data-target="#carousel-example-generic" data-slide-to="0" class="active"></li>
|
||||
<li data-target="#carousel-example-generic" data-slide-to="1"></li>
|
||||
<li data-target="#carousel-example-generic" data-slide-to="2"></li>
|
||||
<li data-target="#carouselExampleIndicators" data-slide-to="0" class="active"></li>
|
||||
<li data-target="#carouselExampleIndicators" data-slide-to="1"></li>
|
||||
<li data-target="#carouselExampleIndicators" data-slide-to="2"></li>
|
||||
</ol>
|
||||
<div class="carousel-inner" role="listbox">
|
||||
<div class="carousel-item active">
|
||||
<img data-src="holder.js/900x500/auto/#777:#555/text:First slide" alt="First slide">
|
||||
<img class="d-block img-fluid" data-src="holder.js/800x400?auto=yes&bg=777&fg=555&text=First slide" alt="First slide">
|
||||
</div>
|
||||
<div class="carousel-item">
|
||||
<img data-src="holder.js/900x500/auto/#666:#444/text:Second slide" alt="Second slide">
|
||||
<img class="d-block img-fluid" data-src="holder.js/800x400?auto=yes&bg=666&fg=444&text=Second slide" alt="Second slide">
|
||||
</div>
|
||||
<div class="carousel-item">
|
||||
<img data-src="holder.js/900x500/auto/#555:#333/text:Third slide" alt="Third slide">
|
||||
<img class="d-block img-fluid" data-src="holder.js/800x400?auto=yes&bg=555&fg=333&text=Third slide" alt="Third slide">
|
||||
</div>
|
||||
</div>
|
||||
<a class="left carousel-control" href="#carousel-example-generic" role="button" data-slide="prev">
|
||||
<span class="icon-prev" aria-hidden="true"></span>
|
||||
<a class="carousel-control-prev" href="#carouselExampleIndicators" role="button" data-slide="prev">
|
||||
<span class="carousel-control-prev-icon" aria-hidden="true"></span>
|
||||
<span class="sr-only">Previous</span>
|
||||
</a>
|
||||
<a class="right carousel-control" href="#carousel-example-generic" role="button" data-slide="next">
|
||||
<span class="icon-next" aria-hidden="true"></span>
|
||||
<a class="carousel-control-next" href="#carouselExampleIndicators" role="button" data-slide="next">
|
||||
<span class="carousel-control-next-icon" aria-hidden="true"></span>
|
||||
<span class="sr-only">Next</span>
|
||||
</a>
|
||||
</div>
|
||||
|
|
@ -55,45 +115,45 @@ Bootstrap exclusively uses CSS3 for its animations, but Internet Explorer 9 does
|
|||
The `.active` class needs to be added to one of the slides. Otherwise, the carousel will not be visible.
|
||||
{% endcallout %}
|
||||
|
||||
### Optional captions
|
||||
### With captions
|
||||
|
||||
Add captions to your slides easily with the `.carousel-caption` element within any `.carousel-item`. Place just about any optional HTML within there and it will be automatically aligned and formatted.
|
||||
Add captions to your slides easily with the `.carousel-caption` element within any `.carousel-item`. They can be easily hidden on smaller viewports, as shown below, with optional [display utilities]({{ site.baseurl }}/utilities/display-property/). We hide them initially with `.d-none` and bring them back on medium-sized devices with `.d-md-block`.
|
||||
|
||||
<div class="bd-example">
|
||||
<div id="carousel-example-captions" class="carousel slide" data-ride="carousel">
|
||||
<div id="carouselExampleCaptions" class="carousel slide" data-ride="carousel">
|
||||
<ol class="carousel-indicators">
|
||||
<li data-target="#carousel-example-captions" data-slide-to="0" class="active"></li>
|
||||
<li data-target="#carousel-example-captions" data-slide-to="1"></li>
|
||||
<li data-target="#carousel-example-captions" data-slide-to="2"></li>
|
||||
<li data-target="#carouselExampleCaptions" data-slide-to="0" class="active"></li>
|
||||
<li data-target="#carouselExampleCaptions" data-slide-to="1"></li>
|
||||
<li data-target="#carouselExampleCaptions" data-slide-to="2"></li>
|
||||
</ol>
|
||||
<div class="carousel-inner" role="listbox">
|
||||
<div class="carousel-item active">
|
||||
<img data-src="holder.js/900x500/auto/#777:#777" alt="First slide image">
|
||||
<div class="carousel-caption">
|
||||
<img class="d-block img-fluid" data-src="holder.js/800x400?auto=yes&bg=777&fg=555&text=First slide" alt="First slide">
|
||||
<div class="carousel-caption d-none d-md-block">
|
||||
<h3>First slide label</h3>
|
||||
<p>Nulla vitae elit libero, a pharetra augue mollis interdum.</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="carousel-item">
|
||||
<img data-src="holder.js/900x500/auto/#666:#666" alt="Second slide image">
|
||||
<div class="carousel-caption">
|
||||
<img class="d-block img-fluid" data-src="holder.js/800x400?auto=yes&bg=666&fg=444&text=Second slide" alt="Second slide">
|
||||
<div class="carousel-caption d-none d-md-block">
|
||||
<h3>Second slide label</h3>
|
||||
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="carousel-item">
|
||||
<img data-src="holder.js/900x500/auto/#555:#555" alt="Third slide image">
|
||||
<div class="carousel-caption">
|
||||
<img class="d-block img-fluid" data-src="holder.js/800x400?auto=yes&bg=555&fg=333&text=Third slide" alt="Third slide">
|
||||
<div class="carousel-caption d-none d-md-block">
|
||||
<h3>Third slide label</h3>
|
||||
<p>Praesent commodo cursus magna, vel scelerisque nisl consectetur.</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<a class="left carousel-control" href="#carousel-example-captions" role="button" data-slide="prev">
|
||||
<a class="carousel-control carousel-control-left" href="#carouselExampleCaptions" role="button" data-slide="prev">
|
||||
<span class="icon-prev" aria-hidden="true"></span>
|
||||
<span class="sr-only">Previous</span>
|
||||
</a>
|
||||
<a class="right carousel-control" href="#carousel-example-captions" role="button" data-slide="next">
|
||||
<a class="carousel-control carousel-control-right" href="#carouselExampleCaptions" role="button" data-slide="next">
|
||||
<span class="icon-next" aria-hidden="true"></span>
|
||||
<span class="sr-only">Next</span>
|
||||
</a>
|
||||
|
|
@ -103,25 +163,15 @@ Add captions to your slides easily with the `.carousel-caption` element within a
|
|||
{% highlight html %}
|
||||
<div class="carousel-item">
|
||||
<img src="..." alt="...">
|
||||
<div class="carousel-caption">
|
||||
<div class="carousel-caption d-none d-md-block">
|
||||
<h3>...</h3>
|
||||
<p>...</p>
|
||||
</div>
|
||||
</div>
|
||||
{% endhighlight %}
|
||||
|
||||
{% callout danger %}
|
||||
#### Accessibility issue
|
||||
|
||||
The carousel component is generally not compliant with accessibility standards. If you need to be compliant, please consider other options for presenting your content.
|
||||
{% endcallout %}
|
||||
|
||||
## Usage
|
||||
|
||||
### Multiple carousels
|
||||
|
||||
Carousels require the use of an `id` on the outermost container (the `.carousel`) for carousel controls to function properly. When adding multiple carousels, or when changing a carousel's `id`, be sure to update the relevant controls.
|
||||
|
||||
### Via data attributes
|
||||
|
||||
Use data attributes to easily control the position of the carousel. `data-slide` accepts the keywords `prev` or `next`, which alters the slide position relative to its current position. Alternatively, use `data-slide-to` to pass a raw slide index to the carousel `data-slide-to="2"`, which shifts the slide position to a particular index beginning with `0`.
|
||||
|
|
@ -157,24 +207,30 @@ Options can be passed via data attributes or JavaScript. For data attributes, ap
|
|||
<td>5000</td>
|
||||
<td>The amount of time to delay between automatically cycling an item. If false, carousel will not automatically cycle.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>keyboard</td>
|
||||
<td>boolean</td>
|
||||
<td>true</td>
|
||||
<td>Whether the carousel should react to keyboard events.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>pause</td>
|
||||
<td>string | null</td>
|
||||
<td>"hover"</td>
|
||||
<td>If set to <code>"hover"</code>, pauses the cycling of the carousel on <code>mouseenter</code> and resumes the cycling of the carousel on <code>mouseleave</code>. If set to <code>null</code>, hovering over the carousel won't pause it.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>ride</td>
|
||||
<td>string</td>
|
||||
<td>false</td>
|
||||
<td>Autoplays the carousel after the user manually cycles the first item. If "carousel", autoplays the carousel on load.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>wrap</td>
|
||||
<td>boolean</td>
|
||||
<td>true</td>
|
||||
<td>Whether the carousel should cycle continuously or have hard stops.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>keyboard</td>
|
||||
<td>boolean</td>
|
||||
<td>true</td>
|
||||
<td>Whether the carousel should react to keyboard events.</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ Click the buttons below to show and hide another element via class changes:
|
|||
|
||||
- `.collapse` hides content
|
||||
- `.collapsing` is applied during transitions
|
||||
- `.collapse.in` shows content
|
||||
- `.collapse.show` shows content
|
||||
|
||||
You can use a link with the `href` attribute, or a button with the `data-target` attribute. In both cases, the `data-toggle="collapse"` is required.
|
||||
|
||||
|
|
@ -53,7 +53,7 @@ Extend the default collapse behavior to create an accordion.
|
|||
</h5>
|
||||
</div>
|
||||
|
||||
<div id="collapseOne" class="collapse in" role="tabpanel" aria-labelledby="headingOne">
|
||||
<div id="collapseOne" class="collapse show" role="tabpanel" aria-labelledby="headingOne">
|
||||
<div class="card-block">
|
||||
Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS.
|
||||
</div>
|
||||
|
|
@ -101,14 +101,14 @@ Additionally, if your control element is targeting a single collapsible element
|
|||
The collapse plugin utilizes a few classes to handle the heavy lifting:
|
||||
|
||||
- `.collapse` hides the content
|
||||
- `.collapse.in` shows the content
|
||||
- `.collapse.show` shows the content
|
||||
- `.collapsing` is added when the transition starts, and removed when it finishes
|
||||
|
||||
These classes can be found in `_animation.scss`.
|
||||
These classes can be found in `_transitions.scss`.
|
||||
|
||||
### Via data attributes
|
||||
|
||||
Just add `data-toggle="collapse"` and a `data-target` to the element to automatically assign control of a collapsible element. The `data-target` attribute accepts a CSS selector to apply the collapse to. Be sure to add the class `collapse` to the collapsible element. If you'd like it to default open, add the additional class `in`.
|
||||
Just add `data-toggle="collapse"` and a `data-target` to the element to automatically assign control of a collapsible element. The `data-target` attribute accepts a CSS selector to apply the collapse to. Be sure to add the class `collapse` to the collapsible element. If you'd like it to default open, add the additional class `show`.
|
||||
|
||||
To add accordion-like group management to a collapsible control, add the data attribute `data-parent="#selector"`. Refer to the demo to see this in action.
|
||||
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ Wrap the dropdown's toggle (your button or link) and the dropdown menu within `.
|
|||
Any single `.btn` can be turned into a dropdown toggle with some markup changes. Here's how you can put them to work with either `<button>` elements:
|
||||
|
||||
{% example html %}
|
||||
<div class="dropdown open">
|
||||
<div class="dropdown show">
|
||||
<button class="btn btn-secondary dropdown-toggle" type="button" id="dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||
Dropdown button
|
||||
</button>
|
||||
|
|
@ -36,7 +36,7 @@ Any single `.btn` can be turned into a dropdown toggle with some markup changes.
|
|||
And with `<a>` elements:
|
||||
|
||||
{% example html %}
|
||||
<div class="dropdown open">
|
||||
<div class="dropdown show">
|
||||
<a class="btn btn-secondary dropdown-toggle" href="https://example.com" id="dropdownMenuLink" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||
Dropdown link
|
||||
</a>
|
||||
|
|
@ -53,7 +53,7 @@ The best part is you can do this with any button variant, too:
|
|||
|
||||
<div class="bd-example">
|
||||
<div class="btn-group">
|
||||
<button type="button" class="btn btn-secondary dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Default</button>
|
||||
<button type="button" class="btn btn-primary dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Primary</button>
|
||||
<div class="dropdown-menu">
|
||||
<a class="dropdown-item" href="#">Action</a>
|
||||
<a class="dropdown-item" href="#">Another action</a>
|
||||
|
|
@ -63,7 +63,7 @@ The best part is you can do this with any button variant, too:
|
|||
</div>
|
||||
</div><!-- /btn-group -->
|
||||
<div class="btn-group">
|
||||
<button type="button" class="btn btn-primary dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Primary</button>
|
||||
<button type="button" class="btn btn-secondary dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Secondary</button>
|
||||
<div class="dropdown-menu">
|
||||
<a class="dropdown-item" href="#">Action</a>
|
||||
<a class="dropdown-item" href="#">Another action</a>
|
||||
|
|
@ -138,8 +138,8 @@ We use this extra class to reduce the horizontal `padding` on either side of the
|
|||
|
||||
<div class="bd-example">
|
||||
<div class="btn-group">
|
||||
<button type="button" class="btn btn-secondary">Default</button>
|
||||
<button type="button" class="btn btn-secondary dropdown-toggle dropdown-toggle-split" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||
<button type="button" class="btn btn-primary">Primary</button>
|
||||
<button type="button" class="btn btn-primary dropdown-toggle dropdown-toggle-split" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||
<span class="sr-only">Toggle Dropdown</span>
|
||||
</button>
|
||||
<div class="dropdown-menu">
|
||||
|
|
@ -151,8 +151,8 @@ We use this extra class to reduce the horizontal `padding` on either side of the
|
|||
</div>
|
||||
</div><!-- /btn-group -->
|
||||
<div class="btn-group">
|
||||
<button type="button" class="btn btn-primary">Primary</button>
|
||||
<button type="button" class="btn btn-primary dropdown-toggle dropdown-toggle-split" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||
<button type="button" class="btn btn-secondary">Secondary</button>
|
||||
<button type="button" class="btn btn-secondary dropdown-toggle dropdown-toggle-split" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||
<span class="sr-only">Toggle Dropdown</span>
|
||||
</button>
|
||||
<div class="dropdown-menu">
|
||||
|
|
@ -407,7 +407,7 @@ Trigger dropdown menus above elements by adding `.dropup` to the parent element.
|
|||
Historically dropdown menu contents *had* to be links, but that's no longer the case with v4. Now you can optionally use `<button>` elements in your dropdowns instead of just `<a>`s.
|
||||
|
||||
{% example html %}
|
||||
<div class="dropdown open">
|
||||
<div class="dropdown show">
|
||||
<button class="btn btn-secondary dropdown-toggle" type="button" id="dropdownMenu2" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||
Dropdown
|
||||
</button>
|
||||
|
|
@ -480,7 +480,7 @@ Add `.disabled` to items in the dropdown to **style them as disabled**.
|
|||
|
||||
## Usage
|
||||
|
||||
Via data attributes or JavaScript, the dropdown plugin toggles hidden content (dropdown menus) by toggling the `.open` class on the parent list item.
|
||||
Via data attributes or JavaScript, the dropdown plugin toggles hidden content (dropdown menus) by toggling the `.show` class on the parent list item.
|
||||
|
||||
On mobile devices, opening a dropdown adds a `.dropdown-backdrop` as a tap area for closing dropdown menus when tapping outside the menu, a requirement for proper iOS support. **This means that switching from an open dropdown menu to a different dropdown menu requires an extra tap on mobile.**
|
||||
|
||||
|
|
|
|||
|
|
@ -152,8 +152,7 @@ Below is a complete list of the specific form controls supported by Bootstrap an
|
|||
<tr>
|
||||
<td class="text-nowrap">
|
||||
{% markdown %}
|
||||
`.form-check`<br>
|
||||
`.form-check-inline`
|
||||
`.form-check`
|
||||
{% endmarkdown %}
|
||||
</td>
|
||||
<td class="text-nowrap">
|
||||
|
|
@ -172,80 +171,80 @@ Here are examples of `.form-control` applied to each textual HTML5 `<input>` `ty
|
|||
|
||||
{% example html %}
|
||||
<div class="form-group row">
|
||||
<label for="example-text-input" class="col-xs-2 col-form-label">Text</label>
|
||||
<div class="col-xs-10">
|
||||
<label for="example-text-input" class="col-2 col-form-label">Text</label>
|
||||
<div class="col-10">
|
||||
<input class="form-control" type="text" value="Artisanal kale" id="example-text-input">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label for="example-search-input" class="col-xs-2 col-form-label">Search</label>
|
||||
<div class="col-xs-10">
|
||||
<label for="example-search-input" class="col-2 col-form-label">Search</label>
|
||||
<div class="col-10">
|
||||
<input class="form-control" type="search" value="How do I shoot web" id="example-search-input">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label for="example-email-input" class="col-xs-2 col-form-label">Email</label>
|
||||
<div class="col-xs-10">
|
||||
<label for="example-email-input" class="col-2 col-form-label">Email</label>
|
||||
<div class="col-10">
|
||||
<input class="form-control" type="email" value="bootstrap@example.com" id="example-email-input">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label for="example-url-input" class="col-xs-2 col-form-label">URL</label>
|
||||
<div class="col-xs-10">
|
||||
<label for="example-url-input" class="col-2 col-form-label">URL</label>
|
||||
<div class="col-10">
|
||||
<input class="form-control" type="url" value="https://getbootstrap.com" id="example-url-input">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label for="example-tel-input" class="col-xs-2 col-form-label">Telephone</label>
|
||||
<div class="col-xs-10">
|
||||
<label for="example-tel-input" class="col-2 col-form-label">Telephone</label>
|
||||
<div class="col-10">
|
||||
<input class="form-control" type="tel" value="1-(555)-555-5555" id="example-tel-input">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label for="example-password-input" class="col-xs-2 col-form-label">Password</label>
|
||||
<div class="col-xs-10">
|
||||
<label for="example-password-input" class="col-2 col-form-label">Password</label>
|
||||
<div class="col-10">
|
||||
<input class="form-control" type="password" value="hunter2" id="example-password-input">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label for="example-number-input" class="col-xs-2 col-form-label">Number</label>
|
||||
<div class="col-xs-10">
|
||||
<label for="example-number-input" class="col-2 col-form-label">Number</label>
|
||||
<div class="col-10">
|
||||
<input class="form-control" type="number" value="42" id="example-number-input">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label for="example-datetime-local-input" class="col-xs-2 col-form-label">Date and time</label>
|
||||
<div class="col-xs-10">
|
||||
<label for="example-datetime-local-input" class="col-2 col-form-label">Date and time</label>
|
||||
<div class="col-10">
|
||||
<input class="form-control" type="datetime-local" value="2011-08-19T13:45:00" id="example-datetime-local-input">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label for="example-date-input" class="col-xs-2 col-form-label">Date</label>
|
||||
<div class="col-xs-10">
|
||||
<label for="example-date-input" class="col-2 col-form-label">Date</label>
|
||||
<div class="col-10">
|
||||
<input class="form-control" type="date" value="2011-08-19" id="example-date-input">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label for="example-month-input" class="col-xs-2 col-form-label">Month</label>
|
||||
<div class="col-xs-10">
|
||||
<label for="example-month-input" class="col-2 col-form-label">Month</label>
|
||||
<div class="col-10">
|
||||
<input class="form-control" type="month" value="2011-08" id="example-month-input">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label for="example-week-input" class="col-xs-2 col-form-label">Week</label>
|
||||
<div class="col-xs-10">
|
||||
<label for="example-week-input" class="col-2 col-form-label">Week</label>
|
||||
<div class="col-10">
|
||||
<input class="form-control" type="week" value="2011-W33" id="example-week-input">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label for="example-time-input" class="col-xs-2 col-form-label">Time</label>
|
||||
<div class="col-xs-10">
|
||||
<label for="example-time-input" class="col-2 col-form-label">Time</label>
|
||||
<div class="col-10">
|
||||
<input class="form-control" type="time" value="13:45:00" id="example-time-input">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label for="example-color-input" class="col-xs-2 col-form-label">Color</label>
|
||||
<div class="col-xs-10">
|
||||
<label for="example-color-input" class="col-2 col-form-label">Color</label>
|
||||
<div class="col-10">
|
||||
<input class="form-control" type="color" value="#563d7c" id="example-color-input">
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -274,62 +273,54 @@ The `.form-group` class is the easiest way to add some structure to forms. Its o
|
|||
|
||||
### Inline forms
|
||||
|
||||
Use the `.form-inline` class to display a series of labels, form controls, and buttons on a single horizontal row. Form controls within inline forms behave differently:
|
||||
Use the `.form-inline` class to display a series of labels, form controls, and buttons on a single horizontal row. Form controls within inline forms vary slightly from their default states.
|
||||
|
||||
- Controls are `display: inline-block` to provide alignment control via `vertical-align` and `margin`.
|
||||
- Controls receive `width: auto` to override the Bootstrap default `width: 100%`.
|
||||
- Controls **only appear inline in viewports that are at least 768px wide** to account for narrow viewports on mobile devices.
|
||||
- Controls are `display: flex`, collapsing any HTML white space and allowing you to provide alignment control with [spacing]({{ site.baseurl }}/utilities/spacing/) and [flexbox]({{ site.baseurl }}/utilities/flexbox/) utilities.
|
||||
- Controls and input groups receive `width: auto` to override the Bootstrap default `width: 100%`.
|
||||
- Controls **only appear inline in viewports that are at least 576px wide** to account for narrow viewports on mobile devices.
|
||||
|
||||
Because of this, you may need to manually address the width and alignment of individual form controls. Lastly, as shown below, you should always include a `<label>` with each form control.
|
||||
|
||||
#### Visible labels
|
||||
You may need to manually address the width and alignment of individual form controls with [spacing utilities]({{ site.baseurl }}/utilities/spacing/) (as shown below). Lastly, be sure to always include a `<label>` with each form control, even if you need to hide it from non-screenreader visitors with `.sr-only`.
|
||||
|
||||
{% example html %}
|
||||
<form class="form-inline">
|
||||
<div class="form-group">
|
||||
<label for="exampleInputName2">Name</label>
|
||||
<input type="text" class="form-control" id="exampleInputName2" placeholder="Jane Doe">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="exampleInputEmail2">Email</label>
|
||||
<input type="email" class="form-control" id="exampleInputEmail2" placeholder="jane.doe@example.com">
|
||||
</div>
|
||||
<button type="submit" class="btn btn-primary">Send invitation</button>
|
||||
</form>
|
||||
{% endexample %}
|
||||
<label class="sr-only" for="inlineFormInput">Name</label>
|
||||
<input type="text" class="form-control mb-2 mr-sm-2 mb-sm-0" id="inlineFormInput" placeholder="Jane Doe">
|
||||
|
||||
#### Hidden labels
|
||||
<label class="sr-only" for="inlineFormInputGroup">Username</label>
|
||||
<div class="input-group mb-2 mr-sm-2 mb-sm-0">
|
||||
<div class="input-group-addon">@</div>
|
||||
<input type="text" class="form-control" id="inlineFormInputGroup" placeholder="Username">
|
||||
</div>
|
||||
|
||||
{% example html %}
|
||||
<form class="form-inline">
|
||||
<div class="form-group">
|
||||
<label class="sr-only" for="exampleInputEmail3">Email address</label>
|
||||
<input type="email" class="form-control" id="exampleInputEmail3" placeholder="Enter email">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="sr-only" for="exampleInputPassword3">Password</label>
|
||||
<input type="password" class="form-control" id="exampleInputPassword3" placeholder="Password">
|
||||
</div>
|
||||
<div class="form-check">
|
||||
<div class="form-check mb-2 mr-sm-2 mb-sm-0">
|
||||
<label class="form-check-label">
|
||||
<input class="form-check-input" type="checkbox"> Remember me
|
||||
</label>
|
||||
</div>
|
||||
<button type="submit" class="btn btn-primary">Sign in</button>
|
||||
|
||||
<button type="submit" class="btn btn-primary">Submit</button>
|
||||
</form>
|
||||
{% endexample %}
|
||||
|
||||
Custom form controls and selects are also supported.
|
||||
|
||||
{% example html %}
|
||||
<form class="form-inline">
|
||||
<div class="form-group">
|
||||
<label class="sr-only" for="exampleInputAmount">Amount (in dollars)</label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-addon">$</div>
|
||||
<input type="text" class="form-control" id="exampleInputAmount" placeholder="Amount">
|
||||
<div class="input-group-addon">.00</div>
|
||||
</div>
|
||||
</div>
|
||||
<button type="submit" class="btn btn-primary">Transfer cash</button>
|
||||
<label class="mr-sm-2" for="inlineFormCustomSelect">Preference</label>
|
||||
<select class="custom-select mb-2 mr-sm-2 mb-sm-0" id="inlineFormCustomSelect">
|
||||
<option selected>Choose...</option>
|
||||
<option value="1">One</option>
|
||||
<option value="2">Two</option>
|
||||
<option value="3">Three</option>
|
||||
</select>
|
||||
|
||||
<label class="custom-control custom-checkbox mb-2 mr-sm-2 mb-sm-0">
|
||||
<input type="checkbox" class="custom-control-input">
|
||||
<span class="custom-control-indicator"></span>
|
||||
<span class="custom-control-description">Remember my preference</span>
|
||||
</label>
|
||||
|
||||
<button type="submit" class="btn btn-primary">Submit</button>
|
||||
</form>
|
||||
{% endexample %}
|
||||
|
||||
|
|
@ -471,30 +462,42 @@ By default, any number of checkboxes and radios that are immediate sibling will
|
|||
|
||||
### Inline
|
||||
|
||||
Groups of checkboxes or radios that appear on the same horizontal row are similar to their stacked counterparts, but require different HTML and a single class. To switch from stacked to inline, drop the surrounding `<div>`, add `.form-check-inline` to the `<label>`, and keep the `.form-check-input` on the `<input>`.
|
||||
Group checkboxes or radios on the same horizontal row by adding `.form-check-inline` to any `.form-check`.
|
||||
|
||||
{% example html %}
|
||||
<label class="form-check-inline">
|
||||
<input class="form-check-input" type="checkbox" id="inlineCheckbox1" value="option1"> 1
|
||||
</label>
|
||||
<label class="form-check-inline">
|
||||
<input class="form-check-input" type="checkbox" id="inlineCheckbox2" value="option2"> 2
|
||||
</label>
|
||||
<label class="form-check-inline">
|
||||
<input class="form-check-input" type="checkbox" id="inlineCheckbox3" value="option3"> 3
|
||||
</label>
|
||||
<div class="form-check form-check-inline">
|
||||
<label class="form-check-label">
|
||||
<input class="form-check-input" type="checkbox" id="inlineCheckbox1" value="option1"> 1
|
||||
</label>
|
||||
</div>
|
||||
<div class="form-check form-check-inline">
|
||||
<label class="form-check-label">
|
||||
<input class="form-check-input" type="checkbox" id="inlineCheckbox2" value="option2"> 2
|
||||
</label>
|
||||
</div>
|
||||
<div class="form-check form-check-inline disabled">
|
||||
<label class="form-check-label">
|
||||
<input class="form-check-input" type="checkbox" id="inlineCheckbox3" value="option3" disabled> 3
|
||||
</label>
|
||||
</div>
|
||||
{% endexample %}
|
||||
|
||||
{% example html %}
|
||||
<label class="form-check-inline">
|
||||
<input class="form-check-input" type="radio" name="inlineRadioOptions" id="inlineRadio1" value="option1"> 1
|
||||
</label>
|
||||
<label class="form-check-inline">
|
||||
<input class="form-check-input" type="radio" name="inlineRadioOptions" id="inlineRadio2" value="option2"> 2
|
||||
</label>
|
||||
<label class="form-check-inline">
|
||||
<input class="form-check-input" type="radio" name="inlineRadioOptions" id="inlineRadio3" value="option3"> 3
|
||||
</label>
|
||||
<div class="form-check form-check-inline">
|
||||
<label class="form-check-label">
|
||||
<input class="form-check-input" type="radio" name="inlineRadioOptions" id="inlineRadio1" value="option1"> 1
|
||||
</label>
|
||||
</div>
|
||||
<div class="form-check form-check-inline">
|
||||
<label class="form-check-label">
|
||||
<input class="form-check-input" type="radio" name="inlineRadioOptions" id="inlineRadio2" value="option2"> 2
|
||||
</label>
|
||||
</div>
|
||||
<div class="form-check form-check-inline disabled">
|
||||
<label class="form-check-label">
|
||||
<input class="form-check-input" type="radio" name="inlineRadioOptions" id="inlineRadio3" value="option3" disabled> 3
|
||||
</label>
|
||||
</div>
|
||||
{% endexample %}
|
||||
|
||||
### Without labels
|
||||
|
|
@ -516,14 +519,14 @@ Should you have no text within the `<label>`, the input is positioned as you'd e
|
|||
|
||||
## Static controls
|
||||
|
||||
When you need to place plain text next to a form label within a form, use the `.form-control-static` class on an element of your choice. Using an element like `<p>` with a default margin? Be sure to use a margin override (as shown below).
|
||||
When you need to place plain text next to a form label within a form, use the `.form-control-static` class on an element of your choice.
|
||||
|
||||
{% example html %}
|
||||
<form>
|
||||
<div class="form-group row">
|
||||
<label class="col-sm-2 col-form-label">Email</label>
|
||||
<div class="col-sm-10">
|
||||
<p class="form-control-static mb-0">email@example.com</p>
|
||||
<p class="form-control-static">email@example.com</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
|
|
@ -541,7 +544,7 @@ When you need to place plain text next to a form label within a form, use the `.
|
|||
<label class="sr-only">Email</label>
|
||||
<p class="form-control-static">email@example.com</p>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="form-group mx-sm-3">
|
||||
<label for="inputPassword2" class="sr-only">Password</label>
|
||||
<input type="password" class="form-control" id="inputPassword2" placeholder="Password">
|
||||
</div>
|
||||
|
|
@ -585,7 +588,7 @@ Add the `disabled` attribute to a `<fieldset>` to disable all the controls withi
|
|||
{% callout warning %}
|
||||
#### Caveat about link functionality of `<a>`
|
||||
|
||||
By default, browsers will treat all native form controls (`<input>`, `<select>` and `<button>` elements) inside a `<fieldset disabled>` as disabled, preventing both keyboard and mouse interactions on them. However, if your form also includes `<a ... class="btn btn-*">` elements, these will only be given a style of `pointer-events: none`. As noted in the section about [disabled state for buttons]({{ site.baseurl }}/buttons/#disabled-state) (and specifically in the sub-section for anchor elements), this CSS property is not yet standardized and isn't fully supported in Opera 18 and below, or in Internet Explorer 11, and won't prevent keyboard users from being able to focus or activate these links. So to be safe, use custom JavaScript to disable such links.
|
||||
By default, browsers will treat all native form controls (`<input>`, `<select>` and `<button>` elements) inside a `<fieldset disabled>` as disabled, preventing both keyboard and mouse interactions on them. However, if your form also includes `<a ... class="btn btn-*">` elements, these will only be given a style of `pointer-events: none`. As noted in the section about [disabled state for buttons]({{ site.baseurl }}/components/buttons/#disabled-state) (and specifically in the sub-section for anchor elements), this CSS property is not yet standardized and isn't fully supported in Opera 18 and below, or in Internet Explorer 11, and won't prevent keyboard users from being able to focus or activate these links. So to be safe, use custom JavaScript to disable such links.
|
||||
{% endcallout %}
|
||||
|
||||
{% callout danger %}
|
||||
|
|
@ -630,14 +633,14 @@ Wrap inputs in grid columns, or any custom parent element, to easily enforce des
|
|||
|
||||
{% example html %}
|
||||
<div class="row">
|
||||
<div class="col-xs-2">
|
||||
<input type="text" class="form-control" placeholder=".col-xs-2">
|
||||
<div class="col-2">
|
||||
<input type="text" class="form-control" placeholder=".col-2">
|
||||
</div>
|
||||
<div class="col-xs-3">
|
||||
<input type="text" class="form-control" placeholder=".col-xs-3">
|
||||
<div class="col-3">
|
||||
<input type="text" class="form-control" placeholder=".col-3">
|
||||
</div>
|
||||
<div class="col-xs-4">
|
||||
<input type="text" class="form-control" placeholder=".col-xs-4">
|
||||
<div class="col-4">
|
||||
<input type="text" class="form-control" placeholder=".col-4">
|
||||
</div>
|
||||
</div>
|
||||
{% endexample %}
|
||||
|
|
@ -672,7 +675,7 @@ Inline text can use any typical inline HTML element (be it a `<small>`, `<span>`
|
|||
<form class="form-inline">
|
||||
<div class="form-group">
|
||||
<label for="inputPassword4">Password</label>
|
||||
<input type="password" id="inputPassword4" class="form-control" aria-describedby="passwordHelpInline">
|
||||
<input type="password" id="inputPassword4" class="form-control mx-sm-3" aria-describedby="passwordHelpInline">
|
||||
<small id="passwordHelpInline" class="text-muted">
|
||||
Must be 8-20 characters long.
|
||||
</small>
|
||||
|
|
@ -682,7 +685,11 @@ Inline text can use any typical inline HTML element (be it a `<small>`, `<span>`
|
|||
|
||||
## Validation
|
||||
|
||||
Bootstrap includes validation styles for danger, warning, and success states on form controls. Here's a rundown of how they work:
|
||||
Bootstrap includes validation styles for danger, warning, and success states on most form controls.
|
||||
|
||||
### How it works
|
||||
|
||||
Here's a rundown of how they work:
|
||||
|
||||
- To use, add `.has-warning`, `.has-danger`, or `.has-success` to the parent element. Any `.col-form-label`, `.form-control`, or custom form element will receive the validation styles.
|
||||
- Contextual validation text, in addition to your usual form field help text, can be added with the use of `.form-control-feedback`. This text will adapt to the parent `.has-*` class. By default it only includes a bit of `margin` for spacing and a modified `color` for each state.
|
||||
|
|
@ -690,14 +697,14 @@ Bootstrap includes validation styles for danger, warning, and success states on
|
|||
- You may use your own base64 PNGs or SVGs by updating the Sass variables and recompiling.
|
||||
- Icons can also be disabled entirely by setting the variables to `none` or commenting out the source Sass.
|
||||
|
||||
### Defining states
|
||||
|
||||
Generally speaking, you'll want to use a particular state for specific types of feedback:
|
||||
|
||||
- **Danger** is great for when there's a blocking or required field. A user *must* fill in this field properly to submit the form.
|
||||
- **Warning** works well for input values that are in progress, like password strength, or soft validation before a user attempts to submit a form.
|
||||
- And lastly, **success** is ideal for situations when you have per-field validation throughout a form and want to encourage a user through the rest of the fields.
|
||||
|
||||
Here are some examples of the aforementioned classes in action.
|
||||
|
||||
{% comment %}
|
||||
{% callout warning %}
|
||||
#### Conveying validation state to assistive technologies and colorblind users
|
||||
|
|
@ -708,6 +715,10 @@ Ensure that an alternative indication of state is also provided. For instance, y
|
|||
{% endcallout %}
|
||||
{% endcomment %}
|
||||
|
||||
### Examples
|
||||
|
||||
Here are some examples of the aforementioned classes in action. First up is your standard left-aligned fields with labels, help text, and validation messaging.
|
||||
|
||||
{% example html %}
|
||||
<div class="form-group has-success">
|
||||
<label class="form-control-label" for="inputSuccess1">Input with success</label>
|
||||
|
|
@ -729,6 +740,41 @@ Ensure that an alternative indication of state is also provided. For instance, y
|
|||
</div>
|
||||
{% endexample %}
|
||||
|
||||
Those same states can also be used with horizontal forms.
|
||||
|
||||
{% example html %}
|
||||
<div class="container">
|
||||
<form>
|
||||
<div class="form-group row has-success">
|
||||
<label for="inputHorizontalSuccess" class="col-sm-2 col-form-label">Email</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="email" class="form-control form-control-success" id="inputHorizontalSuccess" placeholder="name@example.com">
|
||||
<div class="form-control-feedback">Success! You've done it.</div>
|
||||
<small class="form-text text-muted">Example help text that remains unchanged.</small>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row has-warning">
|
||||
<label for="inputHorizontalWarning" class="col-sm-2 col-form-label">Email</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="email" class="form-control form-control-warning" id="inputHorizontalWarning" placeholder="name@example.com">
|
||||
<div class="form-control-feedback">Shucks, check the formatting of that and try again.</div>
|
||||
<small class="form-text text-muted">Example help text that remains unchanged.</small>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row has-danger">
|
||||
<label for="inputHorizontalDnger" class="col-sm-2 col-form-label">Email</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="email" class="form-control form-control-danger" id="inputHorizontalDnger" placeholder="name@example.com">
|
||||
<div class="form-control-feedback">Sorry, that username's taken. Try another?</div>
|
||||
<small class="form-text text-muted">Example help text that remains unchanged.</small>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
{% endexample %}
|
||||
|
||||
Checkboxes and radios are also supported.
|
||||
|
||||
{% example html %}
|
||||
<div class="form-check has-success">
|
||||
<label class="form-check-label">
|
||||
|
|
@ -887,8 +933,6 @@ Custom `<select>` menus need only a custom class, `.custom-select` to trigger th
|
|||
</select>
|
||||
{% endexample %}
|
||||
|
||||
Custom selects degrade nicely in IE9, receiving only a handful of overrides to remove the custom `background-image`. **Multiple selects (e.g., `<select multiple>`) are not currently supported.**
|
||||
|
||||
### File browser
|
||||
|
||||
The file input is the most gnarly of the bunch and require additional JavaScript if you'd like to hook them up with functional *Choose file...* and selected file name text.
|
||||
|
|
|
|||
|
|
@ -115,7 +115,7 @@ Multiple add-ons are supported and can be mixed with checkbox and radio input ve
|
|||
|
||||
## Button addons
|
||||
|
||||
Buttons in input groups are a bit different and require one extra level of nesting. Instead of `.input-group-addon`, you'll need to use `.input-group-btn` to wrap the buttons. This is required due to default browser styles that cannot be overridden.
|
||||
Buttons in input groups must wrapped in a `.input-group-btn` for proper alignment and sizing. This is required due to default browser styles that cannot be overridden.
|
||||
|
||||
{% example html %}
|
||||
<div class="row">
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ A lightweight, flexible component that can optionally extend the entire viewport
|
|||
<div class="jumbotron">
|
||||
<h1 class="display-3">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-2">
|
||||
<hr class="my-4">
|
||||
<p>It uses utility classes for typography and spacing to space content out within the larger container.</p>
|
||||
<p class="lead">
|
||||
<a class="btn btn-primary btn-lg" href="#" role="button">Learn more</a>
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ description: Learn about Bootstrap's list group component for rendering series o
|
|||
group: components
|
||||
---
|
||||
|
||||
List groups are a flexible and powerful component for displaying not only simple lists of elements, but complex ones with custom content.
|
||||
List groups are a flexible and powerful component for displaying a series of content. List group items can be modified and extended to support just about any content within. They can also be used as navigation with the right modifier class.
|
||||
|
||||
## Contents
|
||||
|
||||
|
|
@ -13,7 +13,7 @@ List groups are a flexible and powerful component for displaying not only simple
|
|||
{:toc}
|
||||
|
||||
## Basic example
|
||||
The most basic list group is simply an unordered list with list items, and the proper classes. Build upon it with the options that follow, or your own CSS as needed.
|
||||
The most basic list group is an unordered list with list items and the proper classes. Build upon it with the options that follow, or with your own CSS as needed.
|
||||
|
||||
{% example html %}
|
||||
<ul class="list-group">
|
||||
|
|
@ -25,46 +25,37 @@ The most basic list group is simply an unordered list with list items, and the p
|
|||
</ul>
|
||||
{% endexample %}
|
||||
|
||||
## Tags
|
||||
## Active items
|
||||
|
||||
Add tags to any list group item to show unread counts, activity, etc.
|
||||
Add `.active` to a `.list-group-item` to indicate the current active selection.
|
||||
|
||||
{% example html %}
|
||||
<ul class="list-group">
|
||||
<li class="list-group-item">
|
||||
<span class="tag tag-default tag-pill float-xs-right">14</span>
|
||||
Cras justo odio
|
||||
</li>
|
||||
<li class="list-group-item">
|
||||
<span class="tag tag-default tag-pill float-xs-right">2</span>
|
||||
Dapibus ac facilisis in
|
||||
</li>
|
||||
<li class="list-group-item">
|
||||
<span class="tag tag-default tag-pill float-xs-right">1</span>
|
||||
Morbi leo risus
|
||||
</li>
|
||||
<li class="list-group-item active">Cras justo odio</li>
|
||||
<li class="list-group-item">Dapibus ac facilisis in</li>
|
||||
<li class="list-group-item">Morbi leo risus</li>
|
||||
<li class="list-group-item">Porta ac consectetur ac</li>
|
||||
<li class="list-group-item">Vestibulum at eros</li>
|
||||
</ul>
|
||||
{% endexample %}
|
||||
|
||||
## Disabled items
|
||||
|
||||
Add `.disabled` to a `.list-group-item` to gray it out to appear disabled.
|
||||
Add `.disabled` to a `.list-group-item` to make it _appear_ disabled. Note that some elements with `.disabled` will also require custom JavaScript to fully disable their click events (e.g., links).
|
||||
|
||||
{% example html %}
|
||||
<div class="list-group">
|
||||
<a href="#" class="list-group-item disabled">
|
||||
Cras justo odio
|
||||
</a>
|
||||
<a href="#" class="list-group-item">Dapibus ac facilisis in</a>
|
||||
<a href="#" class="list-group-item">Morbi leo risus</a>
|
||||
<a href="#" class="list-group-item">Porta ac consectetur ac</a>
|
||||
<a href="#" class="list-group-item">Vestibulum at eros</a>
|
||||
</div>
|
||||
<ul class="list-group">
|
||||
<li class="list-group-item disabled">Cras justo odio</li>
|
||||
<li class="list-group-item">Dapibus ac facilisis in</li>
|
||||
<li class="list-group-item">Morbi leo risus</li>
|
||||
<li class="list-group-item">Porta ac consectetur ac</li>
|
||||
<li class="list-group-item">Vestibulum at eros</li>
|
||||
</ul>
|
||||
{% endexample %}
|
||||
|
||||
## Anchors and buttons
|
||||
## Links and buttons
|
||||
|
||||
Use anchors or buttons to create actionable list group items with hover, disabled, and active states by adding `.list-group-item-action`. This separate class contains a few overrides to add compatibility for `<a>`s and `<button>`s, as well as the hover and focus states.
|
||||
Use `<a>`s or `<button>`s to create _actionable_ list group items with hover, disabled, and active states by adding `.list-group-item-action`. We separate these pseudo-classes to ensure list groups made of non-interactive elements (like `<li>`s or `<div>`s) don't provide a click or tap affordance.
|
||||
|
||||
Be sure to **not use the standard `.btn` classes here**.
|
||||
|
||||
|
|
@ -80,6 +71,8 @@ Be sure to **not use the standard `.btn` classes here**.
|
|||
</div>
|
||||
{% endexample %}
|
||||
|
||||
With `<button>`s, you can also make use of the `disabled` attribute instead of the `.disabled` class. Sadly, `<a>`s don't support the disabled attribute.
|
||||
|
||||
{% example html %}
|
||||
<div class="list-group">
|
||||
<button type="button" class="list-group-item list-group-item-action active">
|
||||
|
|
@ -88,16 +81,29 @@ Be sure to **not use the standard `.btn` classes here**.
|
|||
<button type="button" class="list-group-item list-group-item-action">Dapibus ac facilisis in</button>
|
||||
<button type="button" class="list-group-item list-group-item-action">Morbi leo risus</button>
|
||||
<button type="button" class="list-group-item list-group-item-action">Porta ac consectetur ac</button>
|
||||
<button type="button" class="list-group-item list-group-item-action disabled">Vestibulum at eros</button>
|
||||
<button type="button" class="list-group-item list-group-item-action" disabled>Vestibulum at eros</button>
|
||||
</div>
|
||||
{% endexample %}
|
||||
|
||||
## Contextual classes
|
||||
|
||||
Use contextual classes to style list items, default or linked. Also includes `.active` state.
|
||||
Use contextual classes to style list items with a stateful background and color.
|
||||
|
||||
{% example html %}
|
||||
<ul class="list-group">
|
||||
<li class="list-group-item">Dapibus ac facilisis in</li>
|
||||
<li class="list-group-item list-group-item-success">Dapibus ac facilisis in</li>
|
||||
<li class="list-group-item list-group-item-info">Cras sit amet nibh libero</li>
|
||||
<li class="list-group-item list-group-item-warning">Porta ac consectetur ac</li>
|
||||
<li class="list-group-item list-group-item-danger">Vestibulum at eros</li>
|
||||
</ul>
|
||||
{% endexample %}
|
||||
|
||||
Contextual classes also work with `.list-group-item-action`. Note the addition of the hover styles here not present in the previous example. Also supported is the `.active` state; apply it to indicate an active selection on a contextual list group item.
|
||||
|
||||
{% example html %}
|
||||
<div class="list-group">
|
||||
<a href="#" class="list-group-item list-group-item-action">Dapibus ac facilisis in</a>
|
||||
<a href="#" class="list-group-item list-group-item-action list-group-item-success">Dapibus ac facilisis in</a>
|
||||
<a href="#" class="list-group-item list-group-item-action list-group-item-info">Cras sit amet nibh libero</a>
|
||||
<a href="#" class="list-group-item list-group-item-action list-group-item-warning">Porta ac consectetur ac</a>
|
||||
|
|
@ -108,6 +114,27 @@ Use contextual classes to style list items, default or linked. Also includes `.a
|
|||
{% capture callout-include %}{% include callout-warning-color-assistive-technologies.md %}{% endcapture %}
|
||||
{{ callout-include | markdownify }}
|
||||
|
||||
## With badges
|
||||
|
||||
Add badges to any list group item to show unread counts, activity, and more with the help of some utilities. Note the [`justify-content-between` utility class]({{ site.baseurl }}/layout/grid/#horizontal-alignment) and the badge's placement.
|
||||
|
||||
{% example html %}
|
||||
<ul class="list-group">
|
||||
<li class="list-group-item justify-content-between">
|
||||
Cras justo odio
|
||||
<span class="badge badge-default badge-pill">14</span>
|
||||
</li>
|
||||
<li class="list-group-item justify-content-between">
|
||||
Dapibus ac facilisis in
|
||||
<span class="badge badge-default badge-pill">2</span>
|
||||
</li>
|
||||
<li class="list-group-item justify-content-between">
|
||||
Morbi leo risus
|
||||
<span class="badge badge-default badge-pill">1</span>
|
||||
</li>
|
||||
</ul>
|
||||
{% endexample %}
|
||||
|
||||
## Custom content
|
||||
|
||||
Add nearly any HTML within, even for linked list groups like the one below.
|
||||
|
|
@ -115,16 +142,16 @@ Add nearly any HTML within, even for linked list groups like the one below.
|
|||
{% example html %}
|
||||
<div class="list-group">
|
||||
<a href="#" class="list-group-item list-group-item-action active">
|
||||
<h5 class="list-group-item-heading">List group item heading</h5>
|
||||
<p class="list-group-item-text">Donec id elit non mi porta gravida at eget metus. Maecenas sed diam eget risus varius blandit.</p>
|
||||
<h5 class="mt-0 mb-1">List group item heading</h5>
|
||||
<small>Donec id elit non mi porta gravida at eget metus. Maecenas sed diam eget risus varius blandit.</small>
|
||||
</a>
|
||||
<a href="#" class="list-group-item list-group-item-action">
|
||||
<h5 class="list-group-item-heading">List group item heading</h5>
|
||||
<p class="list-group-item-text">Donec id elit non mi porta gravida at eget metus. Maecenas sed diam eget risus varius blandit.</p>
|
||||
<h5 class="mt-0 mb-1">List group item heading</h5>
|
||||
<small>Donec id elit non mi porta gravida at eget metus. Maecenas sed diam eget risus varius blandit.</small>
|
||||
</a>
|
||||
<a href="#" class="list-group-item list-group-item-action">
|
||||
<h5 class="list-group-item-heading">List group item heading</h5>
|
||||
<p class="list-group-item-text">Donec id elit non mi porta gravida at eget metus. Maecenas sed diam eget risus varius blandit.</p>
|
||||
<h5 class="mt-0 mb-1">List group item heading</h5>
|
||||
<small>Donec id elit non mi porta gravida at eget metus. Maecenas sed diam eget risus varius blandit.</small>
|
||||
</a>
|
||||
</div>
|
||||
{% endexample %}
|
||||
|
|
|
|||
|
|
@ -5,14 +5,28 @@ description: Learn how to use Bootstrap's modals to add dialog prompts to your s
|
|||
group: components
|
||||
---
|
||||
|
||||
Modals are streamlined, but flexible, dialog prompts with the minimum required functionality and smart defaults.
|
||||
Modals are streamlined, but flexible dialog prompts powered by JavaScript. They support a number of use cases from user notification to completely custom content and feature a handful of helpful subcomponents, sizes, and more.
|
||||
|
||||
## Contents
|
||||
|
||||
* Will be replaced with the ToC, excluding the "Contents" header
|
||||
{:toc}
|
||||
|
||||
**Due to how HTML5 defines its semantics, [the `autofocus` HTML attribute](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#attr-autofocus) has no effect in Bootstrap modals.** To achieve the same effect, use some custom JavaScript:
|
||||
## How it works
|
||||
|
||||
Before getting started with Bootstrap's modal component, be sure to read the following as our menu options have recently changed.
|
||||
|
||||
- Modals are built with HTML, CSS, and JavaScript. They're positioned over everything else in the document and remove scroll from the `<body>` so that modal content scrolls instead.
|
||||
- Clicking on the modal "backdrop" will automatically close the modal.
|
||||
- Bootstrap only supports one modal window at a time. Nested modals aren't supported as we believe them to be poor user experiences.
|
||||
- Modal's use `position: fixed`, which can sometimes be a bit particular about it's rendering. Whenever possible, place your modal HTML in a top-level position to avoid potential interference from other elements. You'll likely run into issues when nesting a `.modal` within another fixed element.
|
||||
- One again, due to `position: fixed`, there are some caveats with using modals on mobile devices. [See our browser support docs]({{ site.baseurl }}/getting-started/browsers-devices/#modals-and-dropdowns-on-mobile) for details.
|
||||
- Lastly, the `autofocus` HTML attribute has no affect in modals. Here's how you can achieve the same effect with custom JavaScript.
|
||||
|
||||
Keep reading for demos and usage guidelines.
|
||||
|
||||
|
||||
- Due to how HTML5 defines its semantics, [the `autofocus` HTML attribute](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#attr-autofocus) has no effect in Bootstrap modals. To achieve the same effect, use some custom JavaScript:
|
||||
|
||||
{% highlight js %}
|
||||
$('#myModal').on('shown.bs.modal', function () {
|
||||
|
|
@ -20,48 +34,32 @@ $('#myModal').on('shown.bs.modal', function () {
|
|||
})
|
||||
{% endhighlight %}
|
||||
|
||||
{% callout warning %}
|
||||
#### Multiple open modals not supported
|
||||
## Examples
|
||||
|
||||
Be sure not to open a modal while another is still visible. Showing more than one modal at a time requires custom code.
|
||||
{% endcallout %}
|
||||
### Modal components
|
||||
|
||||
{% callout warning %}
|
||||
#### Modal markup placement
|
||||
|
||||
Always try to place a modal's HTML code in a top-level position in your document to avoid other components affecting the modal's appearance and/or functionality.
|
||||
{% endcallout %}
|
||||
|
||||
{% callout warning %}
|
||||
#### Mobile device caveats
|
||||
|
||||
There are some caveats regarding using modals on mobile devices. [See our browser support docs]({{ site.baseurl }}/getting-started/browsers-devices/#modals-and-dropdowns-on-mobile) for details.
|
||||
{% endcallout %}
|
||||
|
||||
### Static example
|
||||
|
||||
A rendered modal with header, body, and set of actions in the footer.
|
||||
Below is a _static_ modal example (meaning its `position` and `display` have been overridden). Included are the modal header, modal body (required for `padding`), and modal footer (optional). We ask that you include modal headers with dismiss actions whenever possible, or provide another explicit dismiss action.
|
||||
|
||||
<div class="bd-example bd-example-modal">
|
||||
<div class="modal">
|
||||
<div class="modal-dialog" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title">Modal title</h5>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
<h4 class="modal-title">Modal title</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<p>One fine body…</p>
|
||||
<p>Modal body text goes here.</p>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
|
||||
<button type="button" class="btn btn-primary">Save changes</button>
|
||||
</div>
|
||||
</div><!-- /.modal-content -->
|
||||
</div><!-- /.modal-dialog -->
|
||||
</div><!-- /.modal -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% highlight html %}
|
||||
|
|
@ -69,90 +67,68 @@ A rendered modal with header, body, and set of actions in the footer.
|
|||
<div class="modal-dialog" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title">Modal title</h5>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
<h4 class="modal-title">Modal title</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<p>One fine body…</p>
|
||||
<p>Modal body text goes here.</p>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
|
||||
<button type="button" class="btn btn-primary">Save changes</button>
|
||||
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
|
||||
</div>
|
||||
</div><!-- /.modal-content -->
|
||||
</div><!-- /.modal-dialog -->
|
||||
</div><!-- /.modal -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endhighlight %}
|
||||
|
||||
### Live demo
|
||||
|
||||
Toggle a modal via JavaScript by clicking the button below. It will slide down and fade in from the top of the page.
|
||||
Toggle a working modal demo by clicking the button below. It will slide down and fade in from the top of the page.
|
||||
|
||||
<div id="myModal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
|
||||
<div id="exampleModalLive" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="exampleModalLiveLabel" aria-hidden="true">
|
||||
<div class="modal-dialog" role="document">
|
||||
<div class="modal-content">
|
||||
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="exampleModalLiveLabel">Modal title</h5>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
<h4 class="modal-title" id="myModalLabel">Modal title</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<h4>Text in a modal</h4>
|
||||
<p>Duis mollis, est non commodo luctus, nisi erat porttitor ligula.</p>
|
||||
|
||||
<h4>Popover in a modal</h4>
|
||||
<p>This <a href="#" role="button" class="btn btn-secondary popover-test" title="A Title" data-content="And here's some amazing content. It's very engaging. right?">button</a> should trigger a popover on click.</p>
|
||||
|
||||
<h4>Tooltips in a modal</h4>
|
||||
<p><a href="#" class="tooltip-test" title="Tooltip">This link</a> and <a href="#" class="tooltip-test" title="Tooltip">that link</a> should have tooltips on hover.</p>
|
||||
|
||||
<hr>
|
||||
|
||||
<h4>Overflowing text to show scroll behavior</h4>
|
||||
<p>Cras mattis consectetur purus sit amet fermentum. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Morbi leo risus, porta ac consectetur ac, vestibulum at eros.</p>
|
||||
<p>Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor.</p>
|
||||
<p>Aenean lacinia bibendum nulla sed consectetur. Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Donec sed odio dui. Donec ullamcorper nulla non metus auctor fringilla.</p>
|
||||
<p>Cras mattis consectetur purus sit amet fermentum. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Morbi leo risus, porta ac consectetur ac, vestibulum at eros.</p>
|
||||
<p>Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor.</p>
|
||||
<p>Aenean lacinia bibendum nulla sed consectetur. Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Donec sed odio dui. Donec ullamcorper nulla non metus auctor fringilla.</p>
|
||||
<p>Cras mattis consectetur purus sit amet fermentum. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Morbi leo risus, porta ac consectetur ac, vestibulum at eros.</p>
|
||||
<p>Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor.</p>
|
||||
<p>Aenean lacinia bibendum nulla sed consectetur. Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Donec sed odio dui. Donec ullamcorper nulla non metus auctor fringilla.</p>
|
||||
<p>Woohoo, you're reading this text in a modal!</p>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
|
||||
<button type="button" class="btn btn-primary">Save changes</button>
|
||||
</div>
|
||||
|
||||
</div><!-- /.modal-content -->
|
||||
</div><!-- /.modal-dialog -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="bd-example" style="padding-bottom: 24px;">
|
||||
<button type="button" class="btn btn-primary btn-lg" data-toggle="modal" data-target="#myModal">
|
||||
<div class="bd-example">
|
||||
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#exampleModalLive">
|
||||
Launch demo modal
|
||||
</button>
|
||||
</div>
|
||||
|
||||
{% highlight html %}
|
||||
<!-- Button trigger modal -->
|
||||
<button type="button" class="btn btn-primary btn-lg" data-toggle="modal" data-target="#myModal">
|
||||
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#exampleModal">
|
||||
Launch demo modal
|
||||
</button>
|
||||
|
||||
<!-- Modal -->
|
||||
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
|
||||
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="exampleModalLabel">Modal title</h5>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
<h4 class="modal-title" id="myModalLabel">Modal title</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
...
|
||||
|
|
@ -166,19 +142,283 @@ Toggle a modal via JavaScript by clicking the button below. It will slide down a
|
|||
</div>
|
||||
{% endhighlight %}
|
||||
|
||||
{% callout warning %}
|
||||
#### Make modals accessible
|
||||
### Scrolling long content
|
||||
|
||||
Be sure to add `role="dialog"` and `aria-labelledby="..."`, referencing the modal title, to `.modal`, and `role="document"` to the `.modal-dialog` itself.
|
||||
When modals become too long for the user's viewport or device, they scroll independent of the page itself. Try the demo below to see what we mean.
|
||||
|
||||
Additionally, you may give a description of your modal dialog with `aria-describedby` on `.modal`.
|
||||
{% endcallout %}
|
||||
<div id="exampleModalLong" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="exampleModalLongTitle" aria-hidden="true">
|
||||
<div class="modal-dialog" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="exampleModalLongTitle">Modal title</h5>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<p>Cras mattis consectetur purus sit amet fermentum. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Morbi leo risus, porta ac consectetur ac, vestibulum at eros.</p>
|
||||
<p>Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor.</p>
|
||||
<p>Aenean lacinia bibendum nulla sed consectetur. Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Donec sed odio dui. Donec ullamcorper nulla non metus auctor fringilla.</p>
|
||||
<p>Cras mattis consectetur purus sit amet fermentum. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Morbi leo risus, porta ac consectetur ac, vestibulum at eros.</p>
|
||||
<p>Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor.</p>
|
||||
<p>Aenean lacinia bibendum nulla sed consectetur. Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Donec sed odio dui. Donec ullamcorper nulla non metus auctor fringilla.</p>
|
||||
<p>Cras mattis consectetur purus sit amet fermentum. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Morbi leo risus, porta ac consectetur ac, vestibulum at eros.</p>
|
||||
<p>Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor.</p>
|
||||
<p>Aenean lacinia bibendum nulla sed consectetur. Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Donec sed odio dui. Donec ullamcorper nulla non metus auctor fringilla.</p>
|
||||
<p>Cras mattis consectetur purus sit amet fermentum. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Morbi leo risus, porta ac consectetur ac, vestibulum at eros.</p>
|
||||
<p>Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor.</p>
|
||||
<p>Aenean lacinia bibendum nulla sed consectetur. Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Donec sed odio dui. Donec ullamcorper nulla non metus auctor fringilla.</p>
|
||||
<p>Cras mattis consectetur purus sit amet fermentum. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Morbi leo risus, porta ac consectetur ac, vestibulum at eros.</p>
|
||||
<p>Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor.</p>
|
||||
<p>Aenean lacinia bibendum nulla sed consectetur. Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Donec sed odio dui. Donec ullamcorper nulla non metus auctor fringilla.</p>
|
||||
<p>Cras mattis consectetur purus sit amet fermentum. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Morbi leo risus, porta ac consectetur ac, vestibulum at eros.</p>
|
||||
<p>Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor.</p>
|
||||
<p>Aenean lacinia bibendum nulla sed consectetur. Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Donec sed odio dui. Donec ullamcorper nulla non metus auctor fringilla.</p>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
|
||||
<button type="button" class="btn btn-primary">Save changes</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% callout info %}
|
||||
#### Embedding YouTube videos
|
||||
<div class="bd-example">
|
||||
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#exampleModalLong">
|
||||
Launch demo modal
|
||||
</button>
|
||||
</div>
|
||||
|
||||
{% highlight html %}
|
||||
<!-- Button trigger modal -->
|
||||
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#exampleModalLong">
|
||||
Launch demo modal
|
||||
</button>
|
||||
|
||||
<!-- Modal -->
|
||||
<div class="modal fade" id="exampleModalLong" tabindex="-1" role="dialog" aria-labelledby="exampleModalLongTitle" aria-hidden="true">
|
||||
<div class="modal-dialog" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="exampleModalLongTitle">Modal title</h5>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
...
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
|
||||
<button type="button" class="btn btn-primary">Save changes</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endhighlight %}
|
||||
|
||||
### Tooltips and popovers
|
||||
|
||||
[Tooltips]({{ site.baseurl }}/components/tooltips/) and [popovers]({{ site.baseurl }}/components/popovers/) can be placed within modals as needed. When modals are closed, any tooltips and popovers within are also automatically dismissed.
|
||||
|
||||
<div id="exampleModalPopovers" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="exampleModalPopoversLabel" aria-hidden="true">
|
||||
<div class="modal-dialog" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="exampleModalPopoversLabel">Modal title</h5>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<h5>Popover in a modal</h5>
|
||||
<p>This <a href="#" role="button" class="btn btn-secondary popover-test" title="Popover title" data-content="Popover body content is set in this attribute.">button</a> triggers a popover on click.</p>
|
||||
<hr>
|
||||
<h5>Tooltips in a modal</h5>
|
||||
<p><a href="#" class="tooltip-test" title="Tooltip">This link</a> and <a href="#" class="tooltip-test" title="Tooltip">that link</a> have tooltips on hover.</p>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
|
||||
<button type="button" class="btn btn-primary">Save changes</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="bd-example">
|
||||
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#exampleModalPopovers">
|
||||
Launch demo modal
|
||||
</button>
|
||||
</div>
|
||||
|
||||
{% highlight html %}
|
||||
<div class="modal-body">
|
||||
<h5>Popover in a modal</h5>
|
||||
<p>This <a href="#" role="button" class="btn btn-secondary popover-test" title="Popover title" data-content="Popover body content is set in this attribute.">button</a> triggers a popover on click.</p>
|
||||
<hr>
|
||||
<h5>Tooltips in a modal</h5>
|
||||
<p><a href="#" class="tooltip-test" title="Tooltip">This link</a> and <a href="#" class="tooltip-test" title="Tooltip">that link</a> have tooltips on hover.</p>
|
||||
</div>
|
||||
{% endhighlight %}
|
||||
|
||||
### Using the grid
|
||||
|
||||
Utilize the Bootstrap grid system within a modal by nesting `.container-fluid` within the `.modal-body`. Then, use the normal grid system classes as you would anywhere else.
|
||||
|
||||
<div id="gridSystemModal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="gridModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="gridModalLabel">Grids in modals</h5>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="container-fluid bd-example-row">
|
||||
<div class="row">
|
||||
<div class="col-md-4">.col-md-4</div>
|
||||
<div class="col-md-4 col-md-offset-4">.col-md-4 .col-md-offset-4</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-3 col-md-offset-3">.col-md-3 .col-md-offset-3</div>
|
||||
<div class="col-md-2 col-md-offset-4">.col-md-2 .col-md-offset-4</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-6 col-md-offset-3">.col-md-6 .col-md-offset-3</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-sm-9">
|
||||
Level 1: .col-sm-9
|
||||
<div class="row">
|
||||
<div class="col-8 col-sm-6">
|
||||
Level 2: .col-8 .col-sm-6
|
||||
</div>
|
||||
<div class="col-4 col-sm-6">
|
||||
Level 2: .col-4 .col-sm-6
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
|
||||
<button type="button" class="btn btn-primary">Save changes</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="bd-example">
|
||||
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#gridSystemModal">
|
||||
Launch demo modal
|
||||
</button>
|
||||
</div>
|
||||
|
||||
{% highlight html %}
|
||||
<div class="modal-body">
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-md-4">.col-md-4</div>
|
||||
<div class="col-md-4 col-md-offset-4">.col-md-4 .col-md-offset-4</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-3 col-md-offset-3">.col-md-3 .col-md-offset-3</div>
|
||||
<div class="col-md-2 col-md-offset-4">.col-md-2 .col-md-offset-4</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-6 col-md-offset-3">.col-md-6 .col-md-offset-3</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-sm-9">
|
||||
Level 1: .col-sm-9
|
||||
<div class="row">
|
||||
<div class="col-8 col-sm-6">
|
||||
Level 2: .col-8 .col-sm-6
|
||||
</div>
|
||||
<div class="col-4 col-sm-6">
|
||||
Level 2: .col-4 .col-sm-6
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endhighlight %}
|
||||
|
||||
### Varying modal content
|
||||
|
||||
Have a bunch of buttons that all trigger the same modal with slightly different contents? Use `event.relatedTarget` and [HTML `data-*` attributes](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Using_data_attributes) (possibly [via jQuery](https://api.jquery.com/data/)) to vary the contents of the modal depending on which button was clicked.
|
||||
|
||||
Below is a live demo followed by example HTML and JavaScript. For more information, [read the modal events docs](#events) for details on `relatedTarget`.
|
||||
|
||||
{% example html %}
|
||||
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#exampleModal" data-whatever="@mdo">Open modal for @mdo</button>
|
||||
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#exampleModal" data-whatever="@fat">Open modal for @fat</button>
|
||||
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#exampleModal" data-whatever="@getbootstrap">Open modal for @getbootstrap</button>
|
||||
|
||||
<div class="modal fade" id="exampleModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="exampleModalLabel">New message</h5>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<form>
|
||||
<div class="form-group">
|
||||
<label for="recipient-name" class="form-control-label">Recipient:</label>
|
||||
<input type="text" class="form-control" id="recipient-name">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="message-text" class="form-control-label">Message:</label>
|
||||
<textarea class="form-control" id="message-text"></textarea>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
|
||||
<button type="button" class="btn btn-primary">Send message</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endexample %}
|
||||
|
||||
{% highlight js %}
|
||||
$('#exampleModal').on('show.bs.modal', function (event) {
|
||||
var button = $(event.relatedTarget) // Button that triggered the modal
|
||||
var recipient = button.data('whatever') // Extract info from data-* attributes
|
||||
// If necessary, you could initiate an AJAX request here (and then do the updating in a callback).
|
||||
// Update the modal's content. We'll use jQuery here, but you could use a data binding library or other methods instead.
|
||||
var modal = $(this)
|
||||
modal.find('.modal-title').text('New message to ' + recipient)
|
||||
modal.find('.modal-body input').val(recipient)
|
||||
})
|
||||
{% endhighlight %}
|
||||
|
||||
### Remove animation
|
||||
|
||||
For modals that simply appear rather than fade in to view, remove the `.fade` class from your modal markup.
|
||||
|
||||
{% highlight html %}
|
||||
<div class="modal" tabindex="-1" role="dialog" aria-labelledby="..." aria-hidden="true">
|
||||
...
|
||||
</div>
|
||||
{% endhighlight %}
|
||||
|
||||
### Dynamic heights
|
||||
|
||||
If the height of a modal changes while it is open, you should call `$('#myModal').data('bs.modal').handleUpdate()` to readjust the modal's position in case a scrollbar appears.
|
||||
|
||||
### Accessibility
|
||||
|
||||
Be sure to add `role="dialog"` and `aria-labelledby="..."`, referencing the modal title, to `.modal`, and `role="document"` to the `.modal-dialog` itself. Additionally, you may give a description of your modal dialog with `aria-describedby` on `.modal`.
|
||||
|
||||
### Embedding YouTube videos
|
||||
|
||||
Embedding YouTube videos in modals requires additional JavaScript not in Bootstrap to automatically stop playback and more. [See this helpful Stack Overflow post](https://stackoverflow.com/questions/18622508/bootstrap-3-and-youtube-in-modal) for more information.
|
||||
{% endcallout %}
|
||||
|
||||
## Optional sizes
|
||||
|
||||
|
|
@ -218,10 +458,10 @@ Modals have two optional sizes, available via modifier classes to be placed on a
|
|||
<div class="modal-content">
|
||||
|
||||
<div class="modal-header">
|
||||
<h4 class="modal-title" id="myLargeModalLabel">Large modal</h4>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
<h4 class="modal-title" id="myLargeModalLabel">Large modal</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
...
|
||||
|
|
@ -233,12 +473,11 @@ Modals have two optional sizes, available via modifier classes to be placed on a
|
|||
<div class="modal fade bd-example-modal-sm" tabindex="-1" role="dialog" aria-labelledby="mySmallModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog modal-sm">
|
||||
<div class="modal-content">
|
||||
|
||||
<div class="modal-header">
|
||||
<h4 class="modal-title" id="mySmallModalLabel">Small modal</h4>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
<h4 class="modal-title" id="mySmallModalLabel">Small modal</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
...
|
||||
|
|
@ -247,126 +486,6 @@ Modals have two optional sizes, available via modifier classes to be placed on a
|
|||
</div>
|
||||
</div>
|
||||
|
||||
## Remove animation
|
||||
|
||||
For modals that simply appear rather than fade in to view, remove the `.fade` class from your modal markup.
|
||||
|
||||
{% highlight html %}
|
||||
<div class="modal" tabindex="-1" role="dialog" aria-labelledby="..." aria-hidden="true">
|
||||
...
|
||||
</div>
|
||||
{% endhighlight %}
|
||||
|
||||
## Using the grid system
|
||||
|
||||
To take advantage of the Bootstrap grid system within a modal, just nest `.container-fluid` within the `.modal-body` and then use the normal grid system classes within this container.
|
||||
|
||||
{% example html %}
|
||||
<div id="gridSystemModal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="gridModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title" id="gridModalLabel">Modal title</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="container-fluid bd-example-row">
|
||||
<div class="row">
|
||||
<div class="col-md-4">.col-md-4</div>
|
||||
<div class="col-md-4 col-md-offset-4">.col-md-4 .col-md-offset-4</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-3 col-md-offset-3">.col-md-3 .col-md-offset-3</div>
|
||||
<div class="col-md-2 col-md-offset-4">.col-md-2 .col-md-offset-4</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-6 col-md-offset-3">.col-md-6 .col-md-offset-3</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-sm-9">
|
||||
Level 1: .col-sm-9
|
||||
<div class="row">
|
||||
<div class="col-xs-8 col-sm-6">
|
||||
Level 2: .col-xs-8 .col-sm-6
|
||||
</div>
|
||||
<div class="col-xs-4 col-sm-6">
|
||||
Level 2: .col-xs-4 .col-sm-6
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
|
||||
<button type="button" class="btn btn-primary">Save changes</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="bd-example bd-example-padded-bottom">
|
||||
<button type="button" class="btn btn-primary btn-lg" data-toggle="modal" data-target="#gridSystemModal">
|
||||
Launch demo modal
|
||||
</button>
|
||||
</div>
|
||||
{% endexample %}
|
||||
|
||||
## Varying modal content based on trigger button
|
||||
|
||||
Have a bunch of buttons that all trigger the same modal, just with slightly different contents? Use `event.relatedTarget` and [HTML `data-*` attributes](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Using_data_attributes) (possibly [via jQuery](https://api.jquery.com/data/)) to vary the contents of the modal depending on which button was clicked. See the Modal Events docs for details on `relatedTarget`.
|
||||
|
||||
{% example html %}
|
||||
<div class="bd-example">
|
||||
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#exampleModal" data-whatever="@mdo">Open modal for @mdo</button>
|
||||
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#exampleModal" data-whatever="@fat">Open modal for @fat</button>
|
||||
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#exampleModal" data-whatever="@getbootstrap">Open modal for @getbootstrap</button>
|
||||
<div class="modal fade" id="exampleModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
<h4 class="modal-title" id="exampleModalLabel">New message</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<form>
|
||||
<div class="form-group">
|
||||
<label for="recipient-name" class="form-control-label">Recipient:</label>
|
||||
<input type="text" class="form-control" id="recipient-name">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="message-text" class="form-control-label">Message:</label>
|
||||
<textarea class="form-control" id="message-text"></textarea>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
|
||||
<button type="button" class="btn btn-primary">Send message</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endexample %}
|
||||
|
||||
{% highlight js %}
|
||||
$('#exampleModal').on('show.bs.modal', function (event) {
|
||||
var button = $(event.relatedTarget) // Button that triggered the modal
|
||||
var recipient = button.data('whatever') // Extract info from data-* attributes
|
||||
// If necessary, you could initiate an AJAX request here (and then do the updating in a callback).
|
||||
// Update the modal's content. We'll use jQuery here, but you could use a data binding library or other methods instead.
|
||||
var modal = $(this)
|
||||
modal.find('.modal-title').text('New message to ' + recipient)
|
||||
modal.find('.modal-body input').val(recipient)
|
||||
})
|
||||
{% endhighlight %}
|
||||
|
||||
## Modals with dynamic heights
|
||||
|
||||
If the height of a modal changes while it is open, you should call `$('#myModal').data('bs.modal').handleUpdate()` to readjust the modal's position in case a scrollbar appears.
|
||||
|
||||
## Usage
|
||||
|
||||
The modal plugin toggles your hidden content on demand, via data attributes or JavaScript. It also adds `.modal-open` to the `<body>` to override default scrolling behavior and generates a `.modal-backdrop` to provide a click area for dismissing shown modals when clicking outside the modal.
|
||||
|
|
|
|||
|
|
@ -5,53 +5,62 @@ description: Documentation and examples for Bootstrap's powerful, responsive nav
|
|||
group: components
|
||||
---
|
||||
|
||||
The navbar is a simple wrapper for positioning branding, navigation, and other elements into a concise navigation header. It's easily extensible and, with the help of our collapse plugin, it can easily integrate offscreen content.
|
||||
The navbar is a wrapper that positions branding, navigation, and other elements in a concise header. It's easily extensible and, thanks to our Collapse plugin, can easily integrate responsive behaviors.
|
||||
|
||||
## Contents
|
||||
|
||||
* Will be replaced with the ToC, excluding the "Contents" header
|
||||
{:toc}
|
||||
|
||||
## Basics
|
||||
## How it works
|
||||
|
||||
Here's what you need to know before getting started with the navbar:
|
||||
|
||||
- Navbars require a wrapping `.navbar` and a [color scheme](#color-schemes).
|
||||
- Navbars require a wrapping `.navbar` with `.navbar-toggleable-*` for responsive collapsing and [color scheme](#color-schemes) classes.
|
||||
- Navbars and their contents are fluid by default. Use [optional containers](#containers) to limit their horizontal width.
|
||||
- Use `.pull-*-left` and `.pull-*-right` to quickly align sub-components.
|
||||
- Navbars and their contents are built with flexbox, providing easy alignment options via utility classes.
|
||||
- Navbars are responsive by default, but you can easily modify them to change that. Responsive behavior depends on our Collapse JavaScript plugin.
|
||||
- Ensure accessibility by using a `<nav>` element or, if using a more generic element such as a `<div>`, add a `role="navigation"` to every navbar to explicitly identify it as a landmark region for users of assistive technologies.
|
||||
|
||||
Read on for an example and list of supported sub-components.
|
||||
|
||||
## Supported content
|
||||
|
||||
Navbars come with built-in support for a handful of sub-components. Mix and match from the following as you need:
|
||||
Navbars come with built-in support for a handful of sub-components. Choose from the following as needed:
|
||||
|
||||
- `.navbar-brand` for your company, product, or project name
|
||||
- `.navbar-nav` for a full-height and lightweight navigation (including support for dropdowns)
|
||||
- `.navbar-brand` for your company, product, or project name.
|
||||
- `.navbar-nav` for a full-height and lightweight navigation (including support for dropdowns).
|
||||
- `.navbar-toggler` for use with our collapse plugin and other [navigation toggling](#collapsible-content) behaviors.
|
||||
- `.form-inline` for any form controls and actions.
|
||||
- `.navbar-text` for adding vertically centered strings of text.
|
||||
- `.collapse.navbar-collapse` for grouping and hiding navbar contents by a parent breakpoint.
|
||||
|
||||
Here's an example of all the sub-components included in a default, light navbar:
|
||||
Here's an example of all the sub-components included in a responsive light-themed navbar that automatically collapses at the `md` (medium) breakpoint.
|
||||
|
||||
{% example html %}
|
||||
<nav class="navbar navbar-light bg-faded">
|
||||
<nav class="navbar navbar-toggleable-md navbar-light bg-faded">
|
||||
<button class="navbar-toggler navbar-toggler-right" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
|
||||
<span class="navbar-toggler-icon"></span>
|
||||
</button>
|
||||
<a class="navbar-brand" href="#">Navbar</a>
|
||||
<ul class="nav navbar-nav">
|
||||
<li class="nav-item active">
|
||||
<a class="nav-link" href="#">Home <span class="sr-only">(current)</span></a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="#">Features</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="#">Pricing</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="#">About</a>
|
||||
</li>
|
||||
</ul>
|
||||
<form class="form-inline float-xs-right">
|
||||
<input class="form-control" type="text" placeholder="Search">
|
||||
<button class="btn btn-outline-success" type="submit">Search</button>
|
||||
</form>
|
||||
|
||||
<div class="collapse navbar-collapse" id="navbarSupportedContent">
|
||||
<ul class="navbar-nav mr-auto">
|
||||
<li class="nav-item active">
|
||||
<a class="nav-link" href="#">Home <span class="sr-only">(current)</span></a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="#">Link</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link disabled" href="#">Disabled</a>
|
||||
</li>
|
||||
</ul>
|
||||
<form class="form-inline my-2 my-lg-0">
|
||||
<input class="form-control mr-sm-2" type="text" placeholder="Search">
|
||||
<button class="btn btn-outline-success my-2 my-sm-0" type="submit">Search</button>
|
||||
</form>
|
||||
</div>
|
||||
</nav>
|
||||
{% endexample %}
|
||||
|
||||
|
|
@ -60,131 +69,306 @@ Here's an example of all the sub-components included in a default, light navbar:
|
|||
The `.navbar-brand` can be applied to most elements, but an anchor works best as some elements might require utility classes or custom styles.
|
||||
|
||||
{% example html %}
|
||||
<!-- As a link -->
|
||||
<nav class="navbar navbar-light bg-faded">
|
||||
<a class="navbar-brand" href="#">Navbar</a>
|
||||
</nav>
|
||||
|
||||
<!-- As a heading -->
|
||||
<nav class="navbar navbar-light bg-faded">
|
||||
<h1 class="navbar-brand mb-0">Navbar</h1>
|
||||
</nav>
|
||||
{% endexample %}
|
||||
|
||||
Adding images to the `.navbar-brand` will likely always require custom styles or utilities to properly size. Here are some examples to demonstrate.
|
||||
|
||||
{% example html %}
|
||||
<!-- Just an image -->
|
||||
<nav class="navbar navbar-light bg-faded">
|
||||
<a class="navbar-brand" href="#">
|
||||
<img src="{{ site.baseurl }}/assets/brand/bootstrap-solid.svg" width="30" height="30" alt="">
|
||||
</a>
|
||||
</nav>
|
||||
{% endexample %}
|
||||
|
||||
{% example html %}
|
||||
<!-- Image and text -->
|
||||
<nav class="navbar navbar-light bg-faded">
|
||||
<a class="navbar-brand" href="#">
|
||||
<img src="{{ site.baseurl }}/assets/brand/bootstrap-solid.svg" width="30" height="30" class="d-inline-block align-top" alt="">
|
||||
Bootstrap
|
||||
</a>
|
||||
</nav>
|
||||
{% endexample %}
|
||||
|
||||
### Nav
|
||||
|
||||
Navbar navigation is similar to our regular nav options—use the `.nav` base class with a modifier to achieve a particular look. In this case you'll want `.nav.navbar-nav`.
|
||||
Navbar navigation links build on our `.nav` options with their own modifier class and require the use of [toggler classes](#toggler) for proper responsive styling. **Navigation in navbars will also grow to occupy as much horizontal space as possible** to keep your navbar contents securely aligned.
|
||||
|
||||
Active states—with `.active`—to indicate the current page can be applied directly to `.nav-link`s or their immediate parent `.nav-item`s.
|
||||
|
||||
{% example html %}
|
||||
<nav class="navbar navbar-light bg-faded">
|
||||
<ul class="nav navbar-nav">
|
||||
<li class="nav-item active">
|
||||
<a class="nav-link" href="#">Home <span class="sr-only">(current)</span></a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="#">Features</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="#">Pricing</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="#">About</a>
|
||||
</li>
|
||||
</ul>
|
||||
<nav class="navbar navbar-toggleable-md navbar-light bg-faded">
|
||||
<button class="navbar-toggler navbar-toggler-right" type="button" data-toggle="collapse" data-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
|
||||
<span class="navbar-toggler-icon"></span>
|
||||
</button>
|
||||
<a class="navbar-brand" href="#">Navbar</a>
|
||||
<div class="collapse navbar-collapse" id="navbarNav">
|
||||
<ul class="navbar-nav">
|
||||
<li class="nav-item active">
|
||||
<a class="nav-link" href="#">Home <span class="sr-only">(current)</span></a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="#">Features</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="#">Pricing</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link disabled" href="#">Disabled</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</nav>
|
||||
{% endexample %}
|
||||
|
||||
And because we use classes for our navs, you can avoid the list-based approach entirely if you like.
|
||||
|
||||
{% example html %}
|
||||
<nav class="navbar navbar-light bg-faded">
|
||||
<div class="nav navbar-nav">
|
||||
<a class="nav-item nav-link active" href="#">Home <span class="sr-only">(current)</span></a>
|
||||
<a class="nav-item nav-link" href="#">Features</a>
|
||||
<a class="nav-item nav-link" href="#">Pricing</a>
|
||||
<a class="nav-item nav-link" href="#">About</a>
|
||||
<nav class="navbar navbar-toggleable-md navbar-light bg-faded">
|
||||
<button class="navbar-toggler navbar-toggler-right" type="button" data-toggle="collapse" data-target="#navbarNavAltMarkup" aria-controls="navbarNavAltMarkup" aria-expanded="false" aria-label="Toggle navigation">
|
||||
<span class="navbar-toggler-icon"></span>
|
||||
</button>
|
||||
<a class="navbar-brand" href="#">Navbar</a>
|
||||
<div class="collapse navbar-collapse" id="navbarNavAltMarkup">
|
||||
<div class="navbar-nav">
|
||||
<a class="nav-item nav-link active" href="#">Home <span class="sr-only">(current)</span></a>
|
||||
<a class="nav-item nav-link" href="#">Features</a>
|
||||
<a class="nav-item nav-link" href="#">Pricing</a>
|
||||
<a class="nav-item nav-link disabled" href="#">Disabled</a>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
{% endexample %}
|
||||
|
||||
You may also utilize dropdowns in your navbar nav. Dropdown menus require a wrapping element for positioning, so be sure to use separate and nested elements for `.nav-item` and `.nav-link` as shown below.
|
||||
|
||||
{% example html %}
|
||||
<nav class="navbar navbar-toggleable-md navbar-light bg-faded">
|
||||
<button class="navbar-toggler navbar-toggler-right" type="button" data-toggle="collapse" data-target="#navbarNavDropdown" aria-controls="navbarNavDropdown" aria-expanded="false" aria-label="Toggle navigation">
|
||||
<span class="navbar-toggler-icon"></span>
|
||||
</button>
|
||||
<a class="navbar-brand" href="#">Navbar</a>
|
||||
<div class="collapse navbar-collapse" id="navbarNavDropdown">
|
||||
<ul class="navbar-nav">
|
||||
<li class="nav-item active">
|
||||
<a class="nav-link" href="#">Home <span class="sr-only">(current)</span></a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="#">Features</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="#">Pricing</a>
|
||||
</li>
|
||||
<li class="nav-item dropdown">
|
||||
<a class="nav-link dropdown-toggle" href="http://example.com" id="navbarDropdownMenuLink" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||
Dropdown link
|
||||
</a>
|
||||
<div class="dropdown-menu" aria-labelledby="navbarDropdownMenuLink">
|
||||
<a class="dropdown-item" href="#">Action</a>
|
||||
<a class="dropdown-item" href="#">Another action</a>
|
||||
<a class="dropdown-item" href="#">Something else here</a>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</nav>
|
||||
{% endexample %}
|
||||
|
||||
### Forms
|
||||
|
||||
Place various form controls and components within a navbar with `.form-inline`.
|
||||
|
||||
{% example html %}
|
||||
<nav class="navbar navbar-light bg-faded">
|
||||
<form class="form-inline">
|
||||
<input class="form-control mr-sm-2" type="text" placeholder="Search">
|
||||
<button class="btn btn-outline-success my-2 my-sm-0" type="submit">Search</button>
|
||||
</form>
|
||||
</nav>
|
||||
{% endexample %}
|
||||
|
||||
Align the contents of your inline forms with utilities as needed.
|
||||
|
||||
{% example html %}
|
||||
<nav class="navbar navbar-light bg-faded justify-content-between">
|
||||
<a class="navbar-brand">Navbar</a>
|
||||
<form class="form-inline">
|
||||
<input class="form-control mr-sm-2" type="text" placeholder="Search">
|
||||
<button class="btn btn-outline-success my-2 my-sm-0" type="submit">Search</button>
|
||||
</form>
|
||||
</nav>
|
||||
{% endexample %}
|
||||
|
||||
Input groups work, too:
|
||||
|
||||
{% example html %}
|
||||
<nav class="navbar navbar-light bg-faded">
|
||||
<form class="form-inline">
|
||||
<div class="input-group">
|
||||
<span class="input-group-addon" id="basic-addon1">@</span>
|
||||
<input type="text" class="form-control" placeholder="Username" aria-describedby="basic-addon1">
|
||||
</div>
|
||||
</form>
|
||||
</nav>
|
||||
{% endexample %}
|
||||
|
||||
Various buttons are supported as part of these navbar forms, too. This is also a great reminder that vertical alignment utilities can be used to align different sized elements.
|
||||
|
||||
{% example html %}
|
||||
<nav class="navbar navbar-light bg-faded">
|
||||
<form class="form-inline">
|
||||
<button class="btn btn-outline-success" type="button">Main button</button>
|
||||
<button class="btn btn-sm align-middle btn-outline-secondary" type="button">Smaller button</button>
|
||||
</form>
|
||||
</nav>
|
||||
{% endexample %}
|
||||
|
||||
### Text
|
||||
|
||||
Navbars may contain bits of text with the help of `.navbar-text`. This class adjusts vertical alignment and horizontal spacing for strings of text.
|
||||
|
||||
{% example html %}
|
||||
<nav class="navbar navbar-light bg-faded">
|
||||
<span class="navbar-text">
|
||||
Navbar text with an inline element
|
||||
</span>
|
||||
</nav>
|
||||
{% endexample %}
|
||||
|
||||
Mix and match with other components and utilities as needed.
|
||||
|
||||
{% example html %}
|
||||
<nav class="navbar navbar-toggleable-md navbar-light bg-faded">
|
||||
<button class="navbar-toggler navbar-toggler-right" type="button" data-toggle="collapse" data-target="#navbarText" aria-controls="navbarText" aria-expanded="false" aria-label="Toggle navigation">
|
||||
<span class="navbar-toggler-icon"></span>
|
||||
</button>
|
||||
<a class="navbar-brand" href="#">Navbar w/ text</a>
|
||||
<div class="collapse navbar-collapse" id="navbarText">
|
||||
<ul class="navbar-nav mr-auto">
|
||||
<li class="nav-item active">
|
||||
<a class="nav-link" href="#">Home <span class="sr-only">(current)</span></a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="#">Features</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="#">Pricing</a>
|
||||
</li>
|
||||
</ul>
|
||||
<span class="navbar-text">
|
||||
Navbar text with an inline element
|
||||
</span>
|
||||
</div>
|
||||
</nav>
|
||||
{% endexample %}
|
||||
|
||||
## Color schemes
|
||||
|
||||
Theming the navbar has never been easier thanks to the combination of a simple link color modifier class and `background-color` utilities. Put another way, you specify light or dark and apply a background color.
|
||||
|
||||
Here are some examples to show what we mean.
|
||||
Theming the navbar has never been easier thanks to the combination of theming classes and `background-color` utilities. Choose from `.navbar-light` for use with light background colors, or `.navbar-inverse` for dark background colors. Then, customize with `.bg-*` utilities.
|
||||
|
||||
<div class="bd-example">
|
||||
<nav class="navbar navbar-dark bg-inverse">
|
||||
<nav class="navbar navbar-toggleable-md navbar-inverse bg-inverse">
|
||||
<button class="navbar-toggler navbar-toggler-right" type="button" data-toggle="collapse" data-target="#navbarColor01" aria-controls="navbarColor01" aria-expanded="false" aria-label="Toggle navigation">
|
||||
<span class="navbar-toggler-icon"></span>
|
||||
</button>
|
||||
<a class="navbar-brand" href="#">Navbar</a>
|
||||
<ul class="nav navbar-nav">
|
||||
<li class="nav-item active">
|
||||
<a class="nav-link" href="#">Home <span class="sr-only">(current)</span></a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="#">Features</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="#">Pricing</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="#">About</a>
|
||||
</li>
|
||||
</ul>
|
||||
<form class="form-inline float-xs-right">
|
||||
<input class="form-control" type="text" placeholder="Search">
|
||||
<button class="btn btn-outline-info" type="submit">Search</button>
|
||||
</form>
|
||||
|
||||
<div class="collapse navbar-collapse" id="navbarColor01">
|
||||
<ul class="navbar-nav mr-auto">
|
||||
<li class="nav-item active">
|
||||
<a class="nav-link" href="#">Home <span class="sr-only">(current)</span></a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="#">Features</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="#">Pricing</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="#">About</a>
|
||||
</li>
|
||||
</ul>
|
||||
<form class="form-inline">
|
||||
<input class="form-control mr-sm-2" type="text" placeholder="Search">
|
||||
<button class="btn btn-outline-info my-2 my-sm-0" type="submit">Search</button>
|
||||
</form>
|
||||
</div>
|
||||
</nav>
|
||||
<nav class="navbar navbar-dark bg-primary">
|
||||
|
||||
<nav class="navbar navbar-toggleable-md navbar-inverse bg-primary">
|
||||
<button class="navbar-toggler navbar-toggler-right" type="button" data-toggle="collapse" data-target="#navbarColor02" aria-controls="navbarColor02" aria-expanded="false" aria-label="Toggle navigation">
|
||||
<span class="navbar-toggler-icon"></span>
|
||||
</button>
|
||||
<a class="navbar-brand" href="#">Navbar</a>
|
||||
<ul class="nav navbar-nav">
|
||||
<li class="nav-item active">
|
||||
<a class="nav-link" href="#">Home <span class="sr-only">(current)</span></a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="#">Features</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="#">Pricing</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="#">About</a>
|
||||
</li>
|
||||
</ul>
|
||||
<form class="form-inline float-xs-right">
|
||||
<input class="form-control" type="text" placeholder="Search">
|
||||
<button class="btn btn-outline-secondary" type="submit">Search</button>
|
||||
</form>
|
||||
|
||||
<div class="collapse navbar-collapse" id="navbarColor02">
|
||||
<ul class="navbar-nav mr-auto">
|
||||
<li class="nav-item active">
|
||||
<a class="nav-link" href="#">Home <span class="sr-only">(current)</span></a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="#">Features</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="#">Pricing</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="#">About</a>
|
||||
</li>
|
||||
</ul>
|
||||
<form class="form-inline">
|
||||
<input class="form-control mr-sm-2" type="text" placeholder="Search">
|
||||
<button class="btn btn-outline-secondary my-2 my-sm-0" type="submit">Search</button>
|
||||
</form>
|
||||
</div>
|
||||
</nav>
|
||||
<nav class="navbar navbar-light" style="background-color: #e3f2fd;">
|
||||
|
||||
<nav class="navbar navbar-toggleable-md navbar-light" style="background-color: #e3f2fd;">
|
||||
<button class="navbar-toggler navbar-toggler-right" type="button" data-toggle="collapse" data-target="#navbarColor03" aria-controls="navbarColor03" aria-expanded="false" aria-label="Toggle navigation">
|
||||
<span class="navbar-toggler-icon"></span>
|
||||
</button>
|
||||
<a class="navbar-brand" href="#">Navbar</a>
|
||||
<ul class="nav navbar-nav">
|
||||
<li class="nav-item active">
|
||||
<a class="nav-link" href="#">Home <span class="sr-only">(current)</span></a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="#">Features</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="#">Pricing</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="#">About</a>
|
||||
</li>
|
||||
</ul>
|
||||
<form class="form-inline float-xs-right">
|
||||
<input class="form-control" type="text" placeholder="Search">
|
||||
<button class="btn btn-outline-primary" type="submit">Search</button>
|
||||
</form>
|
||||
|
||||
<div class="collapse navbar-collapse" id="navbarColor03">
|
||||
<ul class="navbar-nav mr-auto">
|
||||
<li class="nav-item active">
|
||||
<a class="nav-link" href="#">Home <span class="sr-only">(current)</span></a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="#">Features</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="#">Pricing</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="#">About</a>
|
||||
</li>
|
||||
</ul>
|
||||
<form class="form-inline">
|
||||
<input class="form-control mr-sm-2" type="text" placeholder="Search">
|
||||
<button class="btn btn-outline-primary my-2 my-sm-0" type="submit">Search</button>
|
||||
</form>
|
||||
</div>
|
||||
</nav>
|
||||
</div>
|
||||
|
||||
{% highlight html %}
|
||||
<nav class="navbar navbar-dark bg-inverse">
|
||||
<nav class="navbar navbar-inverse bg-inverse">
|
||||
<!-- Navbar content -->
|
||||
</nav>
|
||||
|
||||
<nav class="navbar navbar-dark bg-primary">
|
||||
<nav class="navbar navbar-inverse bg-primary">
|
||||
<!-- Navbar content -->
|
||||
</nav>
|
||||
|
||||
|
|
@ -199,14 +383,16 @@ Although it's not required, you can wrap a navbar in a `.container` to center it
|
|||
|
||||
{% example html %}
|
||||
<div class="container">
|
||||
<nav class="navbar navbar-light bg-faded">
|
||||
<nav class="navbar navbar-toggleable-md navbar-light bg-faded">
|
||||
<a class="navbar-brand" href="#">Navbar</a>
|
||||
</nav>
|
||||
</div>
|
||||
{% endexample %}
|
||||
|
||||
When the container is within your navbar, its horizontal padding is removed at breakpoints lower than your specified `.navbar-toggleable-*` class. This ensures we're not doubling up on padding unnecessarily on lower viewports when your navbar is collapsed.
|
||||
|
||||
{% example html %}
|
||||
<nav class="navbar navbar-light bg-faded">
|
||||
<nav class="navbar navbar-toggleable-md navbar-light bg-faded">
|
||||
<div class="container">
|
||||
<a class="navbar-brand" href="#">Navbar</a>
|
||||
</div>
|
||||
|
|
@ -218,7 +404,7 @@ Although it's not required, you can wrap a navbar in a `.container` to center it
|
|||
Navbars can be statically placed (their default behavior), static without rounded corners, or fixed to the top or bottom of the viewport.
|
||||
|
||||
{% example html %}
|
||||
<nav class="navbar navbar-full navbar-light bg-faded">
|
||||
<nav class="navbar navbar-light bg-faded">
|
||||
<a class="navbar-brand" href="#">Full width</a>
|
||||
</nav>
|
||||
{% endexample %}
|
||||
|
|
@ -235,44 +421,87 @@ Navbars can be statically placed (their default behavior), static without rounde
|
|||
</nav>
|
||||
{% endexample %}
|
||||
|
||||
## Responsive behaviors
|
||||
|
||||
## Collapsible content
|
||||
Navbars can utilize `.navbar-toggler`, `.navbar-collapse`, and `.navbar-toggleable-*` classes to change when their content collapses behind a button. In combination with other utilities, you can easily choose when to show or hide particular elements.
|
||||
|
||||
Our collapse plugin allows you to use a `<button>` or `<a>` to toggle hidden content.
|
||||
### Toggler
|
||||
|
||||
Navbar togglers can be left or right aligned with `.navbar-toggler-left` or `.navbar-toggler-right` modifiers. These are absolutely positioned within the navbar to avoid interference with the collapsed state. You can also use your own styles to position togglers. Below are examples of different toggle styles.
|
||||
|
||||
With no `.navbar-brand` shown in lowest breakpoint:
|
||||
|
||||
{% example html %}
|
||||
<nav class="navbar navbar-light bg-faded">
|
||||
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#exCollapsingNavbar" aria-controls="exCollapsingNavbar" aria-expanded="false" aria-label="Toggle navigation"></button>
|
||||
<div class="collapse" id="exCollapsingNavbar">
|
||||
<div class="bg-inverse p-1">
|
||||
<h4>Collapsed content</h4>
|
||||
<span class="text-muted">Toggleable via the navbar brand.</span>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
{% endexample %}
|
||||
|
||||
For more complex navbar patterns, like those used in Bootstrap v3, use the `.navbar-toggleable-*` classes in conjunction with the `.navbar-toggler`. These classes override our responsive utilities to show navigation only when content is meant to be shown.
|
||||
|
||||
{% example html %}
|
||||
<nav class="navbar navbar-light bg-faded">
|
||||
<button class="navbar-toggler hidden-sm-up" type="button" data-toggle="collapse" data-target="#exCollapsingNavbar2" aria-controls="exCollapsingNavbar2" aria-expanded="false" aria-label="Toggle navigation"></button>
|
||||
<div class="collapse navbar-toggleable-xs" id="exCollapsingNavbar2">
|
||||
<a class="navbar-brand" href="#">Responsive navbar</a>
|
||||
<ul class="nav navbar-nav">
|
||||
<nav class="navbar navbar-toggleable-md navbar-light bg-faded">
|
||||
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarTogglerDemo01" aria-controls="navbarTogglerDemo01" aria-expanded="false" aria-label="Toggle navigation">
|
||||
<span class="navbar-toggler-icon"></span>
|
||||
</button>
|
||||
<div class="collapse navbar-collapse" id="navbarTogglerDemo01">
|
||||
<a class="navbar-brand" href="#">Hidden brand</a>
|
||||
<ul class="navbar-nav mr-auto mt-2 mt-lg-0">
|
||||
<li class="nav-item active">
|
||||
<a class="nav-link" href="#">Home <span class="sr-only">(current)</span></a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="#">Features</a>
|
||||
<a class="nav-link" href="#">Link</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="#">Pricing</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="#">About</a>
|
||||
<a class="nav-link disabled" href="#">Disabled</a>
|
||||
</li>
|
||||
</ul>
|
||||
<form class="form-inline my-2 my-lg-0">
|
||||
<input class="form-control mr-sm-2" type="text" placeholder="Search">
|
||||
<button class="btn btn-outline-success my-2 my-sm-0" type="submit">Search</button>
|
||||
</form>
|
||||
</div>
|
||||
</nav>
|
||||
{% endexample %}
|
||||
|
||||
With a brand name shown on the left and toggler on the right:
|
||||
|
||||
{% example html %}
|
||||
<nav class="navbar navbar-toggleable-md navbar-light bg-faded">
|
||||
<button class="navbar-toggler navbar-toggler-right" type="button" data-toggle="collapse" data-target="#navbarTogglerDemo02" aria-controls="navbarTogglerDemo02" aria-expanded="false" aria-label="Toggle navigation">
|
||||
<span class="navbar-toggler-icon"></span>
|
||||
</button>
|
||||
<a class="navbar-brand" href="#">Navbar</a>
|
||||
|
||||
<div class="collapse navbar-collapse" id="navbarTogglerDemo02">
|
||||
<ul class="navbar-nav mr-auto mt-2 mt-md-0">
|
||||
<li class="nav-item active">
|
||||
<a class="nav-link" href="#">Home <span class="sr-only">(current)</span></a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="#">Link</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link disabled" href="#">Disabled</a>
|
||||
</li>
|
||||
</ul>
|
||||
<form class="form-inline my-2 my-lg-0">
|
||||
<input class="form-control mr-sm-2" type="text" placeholder="Search">
|
||||
<button class="btn btn-outline-success my-2 my-sm-0" type="submit">Search</button>
|
||||
</form>
|
||||
</div>
|
||||
</nav>
|
||||
{% endexample %}
|
||||
|
||||
### External content
|
||||
|
||||
Sometimes you want to use the collapse plugin to trigger hidden content elsewhere on the page. Because our plugin works on the `id` and `data-target` matching, that's easily done!
|
||||
|
||||
{% example html %}
|
||||
<div class="pos-f-t">
|
||||
<div class="collapse" id="navbarToggleExternalContent">
|
||||
<div class="bg-inverse p-4">
|
||||
<h4 class="text-white">Collapsed content</h4>
|
||||
<span class="text-muted">Toggleable via the navbar brand.</span>
|
||||
</div>
|
||||
</div>
|
||||
<nav class="navbar navbar-inverse bg-inverse">
|
||||
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarToggleExternalContent" aria-controls="navbarToggleExternalContent" aria-expanded="false" aria-label="Toggle navigation">
|
||||
<span class="navbar-toggler-icon"></span>
|
||||
</button>
|
||||
</nav>
|
||||
</div>
|
||||
{% endexample %}
|
||||
|
|
|
|||
|
|
@ -12,13 +12,9 @@ Navigation available in Bootstrap share general markup and styles, from the base
|
|||
* Will be replaced with the ToC, excluding the "Contents" header
|
||||
{:toc}
|
||||
|
||||
## Regarding accessibility
|
||||
|
||||
If you are using navs to provide a navigation bar, be sure to add a `role="navigation"` to the most logical parent container of the `<ul>`, or wrap a `<nav>` element around the whole navigation. Do not add the role to the `<ul>` itself, as this would prevent it from being announced as an actual list by assistive technologies.
|
||||
|
||||
## Base nav
|
||||
|
||||
Roll your own navigation style by extending the base `.nav` component. All Bootstrap's nav components are built on top of this by specifying additional styles. Includes styles for the disabled state, but **not the active state**.
|
||||
The base `.nav` component is built with flexbox and provide a strong foundation for building all types of navigation components. It includes some style overrides (for working with lists), some link padding for larger hit areas, and basic disabled styling. No active states are included in the base nav.
|
||||
|
||||
{% example html %}
|
||||
<ul class="nav">
|
||||
|
|
@ -37,7 +33,7 @@ Roll your own navigation style by extending the base `.nav` component. All Boots
|
|||
</ul>
|
||||
{% endexample %}
|
||||
|
||||
Classes are used throughout, so your markup can be super flexible. Use `<ul>`s like above, or roll your own with say a `<nav>` element. The change in nav item display below **is intentional** as `<li>`s have a different default `display` than regular `<a>` elements.
|
||||
Classes are used throughout, so your markup can be super flexible. Use `<ul>`s like above, or roll your own with say a `<nav>` element. Because the `.nav` uses `display: flex`, the nav links behave the same as nav items would, but without the extra markup.
|
||||
|
||||
{% example html %}
|
||||
<nav class="nav">
|
||||
|
|
@ -48,23 +44,18 @@ Classes are used throughout, so your markup can be super flexible. Use `<ul>`s l
|
|||
</nav>
|
||||
{% endexample %}
|
||||
|
||||
## Inline
|
||||
## Available styles
|
||||
|
||||
Space out nav links in a horizontal band with `.nav-inline`. Longer series of links will wrap to a new line.
|
||||
Change the style of `.nav`s component with modifiers and utilities. Mix and match as needed, or build your own.
|
||||
|
||||
### Horizontal alignment
|
||||
|
||||
Change the horizontal alignment of your nav with [flexbox utilities]({{ site.baseurl }}/layout/grid/#horizontal-alignment). By default, navs are left-aligned, but you can easily change them to center or right aligned.
|
||||
|
||||
Centered with `.justify-content-center`:
|
||||
|
||||
{% example html %}
|
||||
<nav class="nav nav-inline">
|
||||
<a class="nav-link active" href="#">Active</a>
|
||||
<a class="nav-link" href="#">Link</a>
|
||||
<a class="nav-link" href="#">Link</a>
|
||||
<a class="nav-link disabled" href="#">Disabled</a>
|
||||
</nav>
|
||||
{% endexample %}
|
||||
|
||||
The same works for a navigation built with lists.
|
||||
|
||||
{% example html %}
|
||||
<ul class="nav nav-inline">
|
||||
<ul class="nav justify-content-center">
|
||||
<li class="nav-item">
|
||||
<a class="nav-link active" href="#">Active</a>
|
||||
</li>
|
||||
|
|
@ -80,7 +71,58 @@ The same works for a navigation built with lists.
|
|||
</ul>
|
||||
{% endexample %}
|
||||
|
||||
## Tabs
|
||||
Right-aligned with `.justify-content-end`:
|
||||
|
||||
{% example html %}
|
||||
<ul class="nav justify-content-end">
|
||||
<li class="nav-item">
|
||||
<a class="nav-link active" href="#">Active</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="#">Link</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="#">Link</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link disabled" href="#">Disabled</a>
|
||||
</li>
|
||||
</ul>
|
||||
{% endexample %}
|
||||
|
||||
### Vertical
|
||||
|
||||
Stack your navigation by changing the flex item direction with the `.flex-column` utility. Need to stack them on some viewports but not others? Use the responsive versions (e.g., `.flex-sm-column`).
|
||||
|
||||
{% example html %}
|
||||
<ul class="nav flex-column">
|
||||
<li class="nav-item">
|
||||
<a class="nav-link active" href="#">Active</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="#">Link</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="#">Link</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link disabled" href="#">Disabled</a>
|
||||
</li>
|
||||
</ul>
|
||||
{% endexample %}
|
||||
|
||||
As always, vertical navigation is possible without `<ul>`s, too.
|
||||
|
||||
{% example html %}
|
||||
<nav class="nav flex-column">
|
||||
<a class="nav-link active" href="#">Active</a>
|
||||
<a class="nav-link" href="#">Link</a>
|
||||
<a class="nav-link" href="#">Link</a>
|
||||
<a class="nav-link disabled" href="#">Disabled</a>
|
||||
</nav>
|
||||
{% endexample %}
|
||||
|
||||
### Tabs
|
||||
|
||||
Takes the basic nav from above and adds the `.nav-tabs` class to generate a tabbed interface. Use them to create tabbable regions with our [tab JavaScript plugin](#javascript-behavior).
|
||||
|
||||
|
|
@ -101,7 +143,7 @@ Takes the basic nav from above and adds the `.nav-tabs` class to generate a tabb
|
|||
</ul>
|
||||
{% endexample %}
|
||||
|
||||
## Pills
|
||||
### Pills
|
||||
|
||||
Take that same HTML, but use `.nav-pills` instead:
|
||||
|
||||
|
|
@ -122,17 +164,17 @@ Take that same HTML, but use `.nav-pills` instead:
|
|||
</ul>
|
||||
{% endexample %}
|
||||
|
||||
### Stacked pills
|
||||
### Fill and justify
|
||||
|
||||
Add `.nav-stacked` to the `.nav.nav-pills` to stack them vertically. Each `.nav-link` becomes block-level, allowing for larger hit areas via mouse or tap.
|
||||
Force your `.nav`'s contents to extend the full available width one of two modifier classes. To proportionately fill all available space with your `.nav-item`s, use `.nav-fill`. Notice that all horizontal space is occupied, but not every nav item has the same width.
|
||||
|
||||
{% example html %}
|
||||
<ul class="nav nav-pills nav-stacked">
|
||||
<ul class="nav nav-pills nav-fill">
|
||||
<li class="nav-item">
|
||||
<a class="nav-link active" href="#">Active</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="#">Link</a>
|
||||
<a class="nav-link" href="#">Longer nav link</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="#">Link</a>
|
||||
|
|
@ -143,17 +185,42 @@ Add `.nav-stacked` to the `.nav.nav-pills` to stack them vertically. Each `.nav-
|
|||
</ul>
|
||||
{% endexample %}
|
||||
|
||||
As always, stacked pills are possible without `<ul>`s.
|
||||
For equal-width elements, use `.nav-justified`. All horizontal space will be occupied by nav links, but unlike the `.nav-fill` above, every nav item will be the same width.
|
||||
|
||||
{% example html %}
|
||||
<nav class="nav nav-pills nav-stacked">
|
||||
<a class="nav-link active" href="#">Active</a>
|
||||
<a class="nav-link" href="#">Link</a>
|
||||
<a class="nav-link" href="#">Link</a>
|
||||
<a class="nav-link disabled" href="#">Disabled</a>
|
||||
<ul class="nav nav-pills nav-justified">
|
||||
<li class="nav-item">
|
||||
<a class="nav-link active" href="#">Active</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="#">Longer nav link</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="#">Link</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link disabled" href="#">Disabled</a>
|
||||
</li>
|
||||
</ul>
|
||||
{% endexample %}
|
||||
|
||||
## Working with flex utilities
|
||||
|
||||
If you need responsive nav variations, consider using a series of [flex utilities](). While more verbose, these utilities offer greater customization across responsive breakpoints. In the example below, our nav will be stacked on the lowest breakpoint, then adapt to a horizontal layout that fills the available width starting from the small breakpoint.
|
||||
|
||||
{% example html %}
|
||||
<nav class="nav nav-pills flex-column flex-sm-row">
|
||||
<a class="flex-sm-fill text-sm-center nav-link active" href="#">Active</a>
|
||||
<a class="flex-sm-fill text-sm-center nav-link" href="#">Link</a>
|
||||
<a class="flex-sm-fill text-sm-center nav-link" href="#">Link</a>
|
||||
<a class="flex-sm-fill text-sm-center nav-link disabled" href="#">Disabled</a>
|
||||
</nav>
|
||||
{% endexample %}
|
||||
|
||||
## Regarding accessibility
|
||||
|
||||
If you're using navs to provide a navigation bar, be sure to add a `role="navigation"` to the most logical parent container of the `<ul>`, or wrap a `<nav>` element around the whole navigation. Do not add the role to the `<ul>` itself, as this would prevent it from being announced as an actual list by assistive technologies.
|
||||
|
||||
## Using dropdowns
|
||||
|
||||
Add dropdown menus with a little extra HTML and the [dropdowns JavaScript plugin]({{ site.baseurl }}/components/dropdowns/#usage).
|
||||
|
|
@ -233,7 +300,7 @@ Use the tab JavaScript plugin—include it individually or through the compiled
|
|||
</li>
|
||||
</ul>
|
||||
<div class="tab-content" id="myTabContent">
|
||||
<div role="tabpanel" class="tab-pane fade in active" id="home" aria-labelledBy="home-tab">
|
||||
<div role="tabpanel" class="tab-pane fade show active" id="home" aria-labelledBy="home-tab">
|
||||
<p>Raw denim you probably haven't heard of them jean shorts Austin. Nesciunt tofu stumptown aliqua, retro synth master cleanse. Mustache cliche tempor, williamsburg carles vegan helvetica. Reprehenderit butcher retro keffiyeh dreamcatcher synth. Cosby sweater eu banh mi, qui irure terry richardson ex squid. Aliquip placeat salvia cillum iphone. Seitan aliquip quis cardigan american apparel, butcher voluptate nisi qui.</p>
|
||||
</div>
|
||||
<div class="tab-pane fade" id="profile" role="tabpanel" aria-labelledBy="profile-tab">
|
||||
|
|
@ -302,11 +369,11 @@ $('#myTab li:eq(2) a').tab('show') // Select third tab (0-indexed)
|
|||
|
||||
### Fade effect
|
||||
|
||||
To make tabs fade in, add `.fade` to each `.tab-pane`. The first tab pane must also have `.in` to make the initial content visible.
|
||||
To make tabs fade in, add `.fade` to each `.tab-pane`. The first tab pane must also have `.show` to make the initial content visible.
|
||||
|
||||
{% highlight html %}
|
||||
<div class="tab-content">
|
||||
<div class="tab-pane fade in active" id="home" role="tabpanel">...</div>
|
||||
<div class="tab-pane fade show active" id="home" role="tabpanel">...</div>
|
||||
<div class="tab-pane fade" id="profile" role="tabpanel">...</div>
|
||||
<div class="tab-pane fade" id="messages" role="tabpanel">...</div>
|
||||
<div class="tab-pane fade" id="settings" role="tabpanel">...</div>
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ description: Documentation and examples for showing pagination links.
|
|||
group: components
|
||||
---
|
||||
|
||||
Provide pagination links for your site or app with the multi-page pagination component.
|
||||
Pagination links indicate a series of related content exists across multiple pages. Typically these are used where a multi-page approach to long lists of content improves general performance, such as in search results or inboxes.
|
||||
|
||||
## Contents
|
||||
|
||||
|
|
@ -14,10 +14,28 @@ Provide pagination links for your site or app with the multi-page pagination com
|
|||
|
||||
## Overview
|
||||
|
||||
Simple pagination inspired by Rdio, great for apps and search results. The large block is hard to miss, easily scalable, and provides large click areas.
|
||||
We use a large block of connected links for our pagination, making links hard to miss and easily scalable—all while providing large hit areas. Pagination is built with list HTML elements so screen readers can announce the number of available links. Use a wrapping `<nav>` element to identify it as a navigation section to screen readers and other assistive technologies.
|
||||
|
||||
In addition, as pages likely have more than one such navigation section, it's advisable to provide a descriptive `aria-label` for the `<nav>` to reflect its purpose. For example, if the pagination component is used to navigate between a set of search results, an appropriate label could be `aria-label="Search results pages"`.
|
||||
|
||||
{% example html %}
|
||||
<nav aria-label="Page navigation">
|
||||
<nav aria-label="Page navigation example">
|
||||
<ul class="pagination">
|
||||
<li class="page-item"><a class="page-link" href="#">Previous</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 %}
|
||||
|
||||
## Working with icons
|
||||
|
||||
Looking to use an icon or symbol in place of text for some pagination links? Be sure to provide proper screen reader support with `aria` attributes and the `.sr-only` utility.
|
||||
|
||||
{% example html %}
|
||||
<nav aria-label="Page navigation example">
|
||||
<ul class="pagination">
|
||||
<li class="page-item">
|
||||
<a class="page-link" href="#" aria-label="Previous">
|
||||
|
|
@ -28,8 +46,6 @@ Simple pagination inspired by Rdio, great for apps and search results. The large
|
|||
<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="#">4</a></li>
|
||||
<li class="page-item"><a class="page-link" href="#">5</a></li>
|
||||
<li class="page-item">
|
||||
<a class="page-link" href="#" aria-label="Next">
|
||||
<span aria-hidden="true">»</span>
|
||||
|
|
@ -40,43 +56,25 @@ Simple pagination inspired by Rdio, great for apps and search results. The large
|
|||
</nav>
|
||||
{% endexample %}
|
||||
|
||||
{% callout info %}
|
||||
### Labelling the pagination component
|
||||
|
||||
The pagination component should be wrapped in a `<nav>` element to identify it as a navigation section to screen readers and other assistive technologies. In addition, as a page is likely to have more than one such navigation section already (such as the primary navigation in the header, or a sidebar navigation), it is advisable to provide a descriptive `aria-label` for the `<nav>` which reflects its purpose. For example, if the pagination component is used to navigate between a set of search results, an appropriate label could be `aria-label="Search results pages"`.
|
||||
{% endcallout %}
|
||||
|
||||
## Disabled and active states
|
||||
|
||||
Links are customizable for different circumstances. Use `.disabled` for unclickable links and `.active` to indicate the current page.
|
||||
Pagination links are customizable for different circumstances. Use `.disabled` for links that appear un-clickable and `.active` to indicate the current page.
|
||||
|
||||
{% callout warning %}
|
||||
#### Link functionality caveat
|
||||
|
||||
The `.disabled` class uses `pointer-events: none` to try to disable the link functionality of `<a>`s, but that CSS property is not yet standardized. In addition, even in browsers that do support `pointer-events: none`, keyboard navigation remains unaffected, meaning that sighted keyboard users and users of assistive technologies will still be able to activate these links. So to be safe, add a `tabindex="-1"` attribute on these links (to prevent them from receiving keyboard focus) and use custom JavaScript to disable their functionality.
|
||||
{% endcallout %}
|
||||
While the `.disabled` class uses `pointer-events: none` to _try_ to disable the link functionality of `<a>`s, that CSS property is not yet standardized and doesn't account for keyboard navigation. As such, you should always add `tabindex="-1"` on disabled links and use custom JavaScript to fully disable their functionality.
|
||||
|
||||
{% example html %}
|
||||
<nav aria-label="...">
|
||||
<ul class="pagination">
|
||||
<li class="page-item disabled">
|
||||
<a class="page-link" href="#" tabindex="-1" aria-label="Previous">
|
||||
<span aria-hidden="true">«</span>
|
||||
<span class="sr-only">Previous</span>
|
||||
</a>
|
||||
<a class="page-link" href="#" tabindex="-1">Previous</a>
|
||||
</li>
|
||||
<li class="page-item"><a class="page-link" href="#">1</a></li>
|
||||
<li class="page-item active">
|
||||
<a class="page-link" href="#">1 <span class="sr-only">(current)</span></a>
|
||||
<a class="page-link" href="#">2 <span class="sr-only">(current)</span></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="#">4</a></li>
|
||||
<li class="page-item"><a class="page-link" href="#">5</a></li>
|
||||
<li class="page-item">
|
||||
<a class="page-link" href="#" aria-label="Next">
|
||||
<span aria-hidden="true">»</span>
|
||||
<span class="sr-only">Next</span>
|
||||
</a>
|
||||
<a class="page-link" href="#">Next</a>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
|
|
@ -88,17 +86,23 @@ You can optionally swap out active or disabled anchors for `<span>`, or omit the
|
|||
<nav aria-label="...">
|
||||
<ul class="pagination">
|
||||
<li class="page-item disabled">
|
||||
<span class="page-link" aria-label="Previous">
|
||||
<span aria-hidden="true">«</span>
|
||||
<span class="sr-only">Previous</span>
|
||||
<span class="page-link">Previous</span>
|
||||
</li>
|
||||
<li class="page-item"><a class="page-link" href="#">1</a></li>
|
||||
<li class="page-item active">
|
||||
<span class="page-link">
|
||||
2
|
||||
<span class="sr-only">(current)</span>
|
||||
</span>
|
||||
</li>
|
||||
<li class="page-item active"><span class="page-link">1 <span class="sr-only">(current)</span></span></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 %}
|
||||
|
||||
|
||||
## Sizing
|
||||
|
||||
Fancy larger or smaller pagination? Add `.pagination-lg` or `.pagination-sm` for additional sizes.
|
||||
|
|
@ -106,20 +110,14 @@ Fancy larger or smaller pagination? Add `.pagination-lg` or `.pagination-sm` for
|
|||
{% example html %}
|
||||
<nav aria-label="...">
|
||||
<ul class="pagination pagination-lg">
|
||||
<li class="page-item">
|
||||
<a class="page-link" href="#" aria-label="Previous">
|
||||
<span aria-hidden="true">«</span>
|
||||
<span class="sr-only">Previous</span>
|
||||
</a>
|
||||
<li class="page-item disabled">
|
||||
<a class="page-link" href="#" tabindex="-1">Previous</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="#" aria-label="Next">
|
||||
<span aria-hidden="true">»</span>
|
||||
<span class="sr-only">Next</span>
|
||||
</a>
|
||||
<a class="page-link" href="#">Next</a>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
|
|
@ -128,20 +126,50 @@ Fancy larger or smaller pagination? Add `.pagination-lg` or `.pagination-sm` for
|
|||
{% example html %}
|
||||
<nav aria-label="...">
|
||||
<ul class="pagination pagination-sm">
|
||||
<li class="page-item">
|
||||
<a class="page-link" href="#" aria-label="Previous">
|
||||
<span aria-hidden="true">«</span>
|
||||
<span class="sr-only">Previous</span>
|
||||
</a>
|
||||
<li class="page-item disabled">
|
||||
<a class="page-link" href="#" tabindex="-1">Previous</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="#" aria-label="Next">
|
||||
<span aria-hidden="true">»</span>
|
||||
<span class="sr-only">Next</span>
|
||||
</a>
|
||||
<a class="page-link" href="#">Next</a>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
{% endexample %}
|
||||
|
||||
## Alignment
|
||||
|
||||
Change the alignment of pagination components with [flexbox utilities]({{ site.baseurl }}/utilities/flexbox).
|
||||
|
||||
{% example html %}
|
||||
<nav aria-label="Page navigation example">
|
||||
<ul class="pagination justify-content-center">
|
||||
<li class="page-item disabled">
|
||||
<a class="page-link" href="#" tabindex="-1">Previous</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 %}
|
||||
|
||||
{% example html %}
|
||||
<nav aria-label="Page navigation example">
|
||||
<ul class="pagination justify-content-end">
|
||||
<li class="page-item disabled">
|
||||
<a class="page-link" href="#" tabindex="-1">Previous</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>
|
||||
|
|
|
|||
|
|
@ -218,7 +218,7 @@ Options can be passed via data attributes or JavaScript. For data attributes, ap
|
|||
<td>string | function</td>
|
||||
<td>'right'</td>
|
||||
<td>
|
||||
<p>How to position the popover - top | bottom | left | right | auto.<br>When "auto" is specified, it will dynamically reorient the popover. For example, if placement is "auto left", the popover will display to the left when possible, otherwise it will display right.</p>
|
||||
<p>How to position the popover - top | bottom | left | right.</p>
|
||||
<p>When a function is used to determine the placement, it is called with the popover DOM node as its first argument and the triggering element DOM node as its second. The <code>this</code> context is set to the popover instance.</p>
|
||||
</td>
|
||||
</tr>
|
||||
|
|
|
|||
|
|
@ -18,35 +18,22 @@ To caption a progress bar, simply add a `<div>` with your caption text, [align t
|
|||
|
||||
{% example html %}
|
||||
|
||||
<div class="text-xs-center" id="example-caption-1">Reticulating splines… 0%</div>
|
||||
<div class="text-center" id="example-caption-1">Reticulating splines… 0%</div>
|
||||
<progress class="progress" value="0" max="100" aria-describedby="example-caption-1"></progress>
|
||||
|
||||
<div class="text-xs-center" id="example-caption-2">Reticulating splines… 25%</div>
|
||||
<div class="text-center" id="example-caption-2">Reticulating splines… 25%</div>
|
||||
<progress class="progress" value="25" max="100" aria-describedby="example-caption-2"></progress>
|
||||
|
||||
<div class="text-xs-center" id="example-caption-3">Reticulating splines… 50%</div>
|
||||
<div class="text-center" id="example-caption-3">Reticulating splines… 50%</div>
|
||||
<progress class="progress" value="50" max="100" aria-describedby="example-caption-3"></progress>
|
||||
|
||||
<div class="text-xs-center" id="example-caption-4">Reticulating splines… 75%</div>
|
||||
<div class="text-center" id="example-caption-4">Reticulating splines… 75%</div>
|
||||
<progress class="progress" value="75" max="100" aria-describedby="example-caption-4"></progress>
|
||||
|
||||
<div class="text-xs-center" id="example-caption-5">Reticulating splines… 100%</div>
|
||||
<div class="text-center" id="example-caption-5">Reticulating splines… 100%</div>
|
||||
<progress class="progress" value="100" max="100" aria-describedby="example-caption-5"></progress>
|
||||
{% endexample %}
|
||||
|
||||
## IE9 support
|
||||
|
||||
Internet Explorer 9 doesn't support the HTML5 `<progress>` element, but we can work around that.
|
||||
|
||||
{% example html %}
|
||||
<div class="text-xs-center" id="example-caption-6">Reticulating splines… 25%</div>
|
||||
<progress class="progress" value="25" max="100" aria-describedby="example-caption-6">
|
||||
<div class="progress">
|
||||
<span class="progress-bar" style="width: 25%;"></span>
|
||||
</div>
|
||||
</progress>
|
||||
{% endexample %}
|
||||
|
||||
## Contextual alternatives
|
||||
|
||||
Progress bars use some of the same button and alert classes for consistent styles.
|
||||
|
|
@ -74,7 +61,7 @@ Uses a gradient to create a striped effect.
|
|||
|
||||
The striped gradient can also be animated. Add `.progress-animated` to `.progress` to animate the stripes right to left via CSS3 animations.
|
||||
|
||||
**Animated progress bars do not work in IE9 and Opera 12** – as they don't support CSS3 animations – **nor in IE10+ and Microsoft Edge** – as they currently don't support CSS3 animations on the [`::-ms-fill` pseudo-element](https://msdn.microsoft.com/en-us/library/windows/apps/hh465757.aspx).
|
||||
**Animated progress bars don't work in Opera 12**—as they don't support CSS3 animations. They also **don't work in IE10+ and Microsoft Edge** as those browsers currently don't support CSS3 animations on the [`::-ms-fill` pseudo-element](https://msdn.microsoft.com/en-us/library/windows/apps/hh465757.aspx).
|
||||
|
||||
<div class="bd-example">
|
||||
<progress class="progress progress-striped" value="25" max="100"></progress>
|
||||
|
|
|
|||
|
|
@ -15,8 +15,8 @@ group: components
|
|||
The ScrollSpy plugin is for automatically updating nav targets based on scroll position. Scroll the area below the navbar and watch the active class change. The dropdown sub items will be highlighted as well.
|
||||
|
||||
<div class="bd-example">
|
||||
<nav id="navbar-example2" class="navbar navbar-default">
|
||||
<h3 class="navbar-brand">Project Name</h3>
|
||||
<nav id="navbar-example2" class="navbar navbar-light bg-faded">
|
||||
<a class="navbar-brand" href="#">Navbar</a>
|
||||
<ul class="nav nav-pills">
|
||||
<li class="nav-item"><a class="nav-link" href="#fat">@fat</a></li>
|
||||
<li class="nav-item"><a class="nav-link" href="#mdo">@mdo</a></li>
|
||||
|
|
|
|||
|
|
@ -1,50 +0,0 @@
|
|||
---
|
||||
layout: docs
|
||||
title: Tags
|
||||
description: Documentation and examples for tags, our small label-badge component.
|
||||
group: components
|
||||
---
|
||||
|
||||
Small and adaptive tag for adding context to just about any content.
|
||||
|
||||
## Example
|
||||
|
||||
Tags scale to match the size of the immediate parent element by using relative font sizing and `em` units.
|
||||
|
||||
{% example html %}
|
||||
<h1>Example heading <span class="tag tag-default">New</span></h1>
|
||||
<h2>Example heading <span class="tag tag-default">New</span></h2>
|
||||
<h3>Example heading <span class="tag tag-default">New</span></h3>
|
||||
<h4>Example heading <span class="tag tag-default">New</span></h4>
|
||||
<h5>Example heading <span class="tag tag-default">New</span></h5>
|
||||
<h6>Example heading <span class="tag tag-default">New</span></h6>
|
||||
{% endexample %}
|
||||
|
||||
## Contextual variations
|
||||
|
||||
Add any of the below mentioned modifier classes to change the appearance of a tag.
|
||||
|
||||
{% example html %}
|
||||
<span class="tag tag-default">Default</span>
|
||||
<span class="tag tag-primary">Primary</span>
|
||||
<span class="tag tag-success">Success</span>
|
||||
<span class="tag tag-info">Info</span>
|
||||
<span class="tag tag-warning">Warning</span>
|
||||
<span class="tag tag-danger">Danger</span>
|
||||
{% endexample %}
|
||||
|
||||
{% capture callout-include %}{% include callout-warning-color-assistive-technologies.md %}{% endcapture %}
|
||||
{{ callout-include | markdownify }}
|
||||
|
||||
## Pill tags
|
||||
|
||||
Use the `.tag-pill` modifier class to make tags more rounded (with a larger `border-radius` and additional horizontal `padding`). Useful if you miss the badges from v3.
|
||||
|
||||
{% example html %}
|
||||
<span class="tag tag-pill tag-default">Default</span>
|
||||
<span class="tag tag-pill tag-primary">Primary</span>
|
||||
<span class="tag tag-pill tag-success">Success</span>
|
||||
<span class="tag tag-pill tag-info">Info</span>
|
||||
<span class="tag tag-pill tag-warning">Warning</span>
|
||||
<span class="tag tag-pill tag-danger">Danger</span>
|
||||
{% endexample %}
|
||||
|
|
@ -165,7 +165,7 @@ Options can be passed via data attributes or JavaScript. For data attributes, ap
|
|||
</tr>
|
||||
<tr>
|
||||
<td>container</td>
|
||||
<td>string | false</td>
|
||||
<td>string | element | false</td>
|
||||
<td>false</td>
|
||||
<td>
|
||||
<p>Appends the tooltip to a specific element. Example: <code>container: 'body'</code>. This option is particularly useful in that it allows you to position the tooltip in the flow of the document near the triggering element - which will prevent the tooltip from floating away from the triggering element during a window resize.</p>
|
||||
|
|
|
|||
|
|
@ -21,6 +21,6 @@ Aligning the figure's caption is easy with our [text utilities]({{ site.baseurl
|
|||
{% example html %}
|
||||
<figure class="figure">
|
||||
<img data-src="holder.js/400x300" class="figure-img img-fluid rounded" alt="A generic square placeholder image with rounded corners in a figure.">
|
||||
<figcaption class="figure-caption text-xs-right">A caption for the above image.</figcaption>
|
||||
<figcaption class="figure-caption text-right">A caption for the above image.</figcaption>
|
||||
</figure>
|
||||
{% endexample %}
|
||||
|
|
|
|||
|
|
@ -47,13 +47,13 @@ In addition to our [border-radius utilities]({{ site.baseurl }}/utilities/border
|
|||
Align images with the [helper float classes]({{ site.baseurl }}/utilities/responsive-helpers/#responsive-floats) or [text alignment classes]({{ site.baseurl }}/utilities/typography/#text-alignment). `block`-level images can be centered using [the `.mx-auto` margin utility class]({{ site.baseurl }}/utilities/spacing/#horizontal-centering).
|
||||
|
||||
<div class="bd-example bd-example-images">
|
||||
<img data-src="holder.js/200x200" class="rounded float-xs-left" alt="A generic square placeholder image with rounded corners">
|
||||
<img data-src="holder.js/200x200" class="rounded float-xs-right" alt="A generic square placeholder image with rounded corners">
|
||||
<img data-src="holder.js/200x200" class="rounded float-left" alt="A generic square placeholder image with rounded corners">
|
||||
<img data-src="holder.js/200x200" class="rounded float-right" alt="A generic square placeholder image with rounded corners">
|
||||
</div>
|
||||
|
||||
{% highlight html %}
|
||||
<img src="..." class="rounded float-xs-left" alt="...">
|
||||
<img src="..." class="rounded float-xs-right" alt="...">
|
||||
<img src="..." class="rounded float-left" alt="...">
|
||||
<img src="..." class="rounded float-right" alt="...">
|
||||
{% endhighlight %}
|
||||
|
||||
<div class="bd-example bd-example-images">
|
||||
|
|
@ -65,13 +65,13 @@ Align images with the [helper float classes]({{ site.baseurl }}/utilities/respon
|
|||
{% endhighlight %}
|
||||
|
||||
<div class="bd-example bd-example-images">
|
||||
<div class="text-xs-center">
|
||||
<div class="text-center">
|
||||
<img data-src="holder.js/200x200" class="rounded" alt="A generic square placeholder image with rounded corners">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% highlight html %}
|
||||
<div class="text-xs-center">
|
||||
<div class="text-center">
|
||||
<img src="..." class="rounded" alt="...">
|
||||
</div>
|
||||
{% endhighlight %}
|
||||
|
|
|
|||
|
|
@ -41,7 +41,9 @@ The default web fonts (Helvetica Neue, Helvetica, and Arial) have been dropped i
|
|||
$font-family-sans-serif:
|
||||
// Safari for OS X and iOS (San Francisco)
|
||||
-apple-system,
|
||||
// Chrome for OS X (San Francisco)
|
||||
// Chrome >= 56 for OS X (San Francisco), Windows, Linux and Android
|
||||
system-ui,
|
||||
// Chrome < 56 for OS X (San Francisco)
|
||||
BlinkMacSystemFont,
|
||||
// Windows
|
||||
"Segoe UI",
|
||||
|
|
@ -309,7 +311,7 @@ The `<abbr>` element receives basic styling to make it stand out amongst paragra
|
|||
|
||||
## HTML5 `[hidden]` attribute
|
||||
|
||||
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 IE9-10, the explicit declaration in our CSS gets around that problem.
|
||||
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.
|
||||
|
||||
{% highlight html %}
|
||||
<input type="text" hidden>
|
||||
|
|
|
|||
|
|
@ -442,52 +442,50 @@ Add `.table-sm` to make tables more compact by cutting cell padding in half.
|
|||
|
||||
Use contextual classes to color table rows or individual cells.
|
||||
|
||||
<div class="table-responsive">
|
||||
<table class="table table-bordered table-striped">
|
||||
<colgroup>
|
||||
<col class="col-xs-1">
|
||||
<col class="col-xs-7">
|
||||
</colgroup>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Class</th>
|
||||
<th>Description</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<th scope="row">
|
||||
<code>.table-active</code>
|
||||
</th>
|
||||
<td>Applies the hover color to a particular row or cell</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">
|
||||
<code>.table-success</code>
|
||||
</th>
|
||||
<td>Indicates a successful or positive action</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">
|
||||
<code>.table-info</code>
|
||||
</th>
|
||||
<td>Indicates a neutral informative change or action</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">
|
||||
<code>.table-warning</code>
|
||||
</th>
|
||||
<td>Indicates a warning that might need attention</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">
|
||||
<code>.table-danger</code>
|
||||
</th>
|
||||
<td>Indicates a dangerous or potentially negative action</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<table class="table table-bordered table-striped table-responsive">
|
||||
<colgroup>
|
||||
<col class="col-1">
|
||||
<col class="col-7">
|
||||
</colgroup>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Class</th>
|
||||
<th>Description</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<th scope="row">
|
||||
<code>.table-active</code>
|
||||
</th>
|
||||
<td>Applies the hover color to a particular row or cell</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">
|
||||
<code>.table-success</code>
|
||||
</th>
|
||||
<td>Indicates a successful or positive action</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">
|
||||
<code>.table-info</code>
|
||||
</th>
|
||||
<td>Indicates a neutral informative change or action</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">
|
||||
<code>.table-warning</code>
|
||||
</th>
|
||||
<td>Indicates a warning that might need attention</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">
|
||||
<code>.table-danger</code>
|
||||
</th>
|
||||
<td>Indicates a dangerous or potentially negative action</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<div class="bd-example">
|
||||
<table class="table">
|
||||
|
|
@ -670,7 +668,7 @@ Regular table background variants are not available with the inverse table, howe
|
|||
|
||||
## Responsive tables
|
||||
|
||||
Create responsive tables by wrapping any `.table` in `.table-responsive` to make them scroll horizontally on small devices (under 768px). When viewing on anything larger than 768px wide, you will not see any difference in these tables.
|
||||
Create responsive tables by adding `.table-responsive` to any `.table` to make them scroll horizontally on small devices (under 768px). When viewing on anything larger than 768px wide, you will not see any difference in these tables.
|
||||
|
||||
{% callout warning %}
|
||||
#### Vertical clipping/truncation
|
||||
|
|
@ -678,118 +676,98 @@ Create responsive tables by wrapping any `.table` in `.table-responsive` to make
|
|||
Responsive tables make use of `overflow-y: hidden`, which clips off any content that goes beyond the bottom or top edges of the table. In particular, this can clip off dropdown menus and other third-party widgets.
|
||||
{% endcallout %}
|
||||
|
||||
{% callout warning %}
|
||||
#### Firefox and fieldsets
|
||||
|
||||
Firefox has some awkward fieldset styling involving `width` that interferes with the responsive table. This cannot be overridden without a Firefox-specific hack that we **don't** provide in Bootstrap:
|
||||
|
||||
{% highlight css %}
|
||||
@-moz-document url-prefix() {
|
||||
fieldset { display: table-cell; }
|
||||
}
|
||||
{% endhighlight %}
|
||||
|
||||
For more information, read [this Stack Overflow answer](https://stackoverflow.com/questions/17408815/fieldset-resizes-wrong-appears-to-have-unremovable-min-width-min-content/17863685#17863685).
|
||||
{% endcallout %}
|
||||
|
||||
<div class="bd-example">
|
||||
<div class="table-responsive">
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>#</th>
|
||||
<th>Table heading</th>
|
||||
<th>Table heading</th>
|
||||
<th>Table heading</th>
|
||||
<th>Table heading</th>
|
||||
<th>Table heading</th>
|
||||
<th>Table heading</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<th scope="row">1</th>
|
||||
<td>Table cell</td>
|
||||
<td>Table cell</td>
|
||||
<td>Table cell</td>
|
||||
<td>Table cell</td>
|
||||
<td>Table cell</td>
|
||||
<td>Table cell</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">2</th>
|
||||
<td>Table cell</td>
|
||||
<td>Table cell</td>
|
||||
<td>Table cell</td>
|
||||
<td>Table cell</td>
|
||||
<td>Table cell</td>
|
||||
<td>Table cell</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">3</th>
|
||||
<td>Table cell</td>
|
||||
<td>Table cell</td>
|
||||
<td>Table cell</td>
|
||||
<td>Table cell</td>
|
||||
<td>Table cell</td>
|
||||
<td>Table cell</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<table class="table table-responsive">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>#</th>
|
||||
<th>Table heading</th>
|
||||
<th>Table heading</th>
|
||||
<th>Table heading</th>
|
||||
<th>Table heading</th>
|
||||
<th>Table heading</th>
|
||||
<th>Table heading</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<th scope="row">1</th>
|
||||
<td>Table cell</td>
|
||||
<td>Table cell</td>
|
||||
<td>Table cell</td>
|
||||
<td>Table cell</td>
|
||||
<td>Table cell</td>
|
||||
<td>Table cell</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">2</th>
|
||||
<td>Table cell</td>
|
||||
<td>Table cell</td>
|
||||
<td>Table cell</td>
|
||||
<td>Table cell</td>
|
||||
<td>Table cell</td>
|
||||
<td>Table cell</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">3</th>
|
||||
<td>Table cell</td>
|
||||
<td>Table cell</td>
|
||||
<td>Table cell</td>
|
||||
<td>Table cell</td>
|
||||
<td>Table cell</td>
|
||||
<td>Table cell</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<div class="table-responsive">
|
||||
<table class="table table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>#</th>
|
||||
<th>Table heading</th>
|
||||
<th>Table heading</th>
|
||||
<th>Table heading</th>
|
||||
<th>Table heading</th>
|
||||
<th>Table heading</th>
|
||||
<th>Table heading</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<th scope="row">1</th>
|
||||
<td>Table cell</td>
|
||||
<td>Table cell</td>
|
||||
<td>Table cell</td>
|
||||
<td>Table cell</td>
|
||||
<td>Table cell</td>
|
||||
<td>Table cell</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">2</th>
|
||||
<td>Table cell</td>
|
||||
<td>Table cell</td>
|
||||
<td>Table cell</td>
|
||||
<td>Table cell</td>
|
||||
<td>Table cell</td>
|
||||
<td>Table cell</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">3</th>
|
||||
<td>Table cell</td>
|
||||
<td>Table cell</td>
|
||||
<td>Table cell</td>
|
||||
<td>Table cell</td>
|
||||
<td>Table cell</td>
|
||||
<td>Table cell</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<table class="table table-bordered table-responsive">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>#</th>
|
||||
<th>Table heading</th>
|
||||
<th>Table heading</th>
|
||||
<th>Table heading</th>
|
||||
<th>Table heading</th>
|
||||
<th>Table heading</th>
|
||||
<th>Table heading</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<th scope="row">1</th>
|
||||
<td>Table cell</td>
|
||||
<td>Table cell</td>
|
||||
<td>Table cell</td>
|
||||
<td>Table cell</td>
|
||||
<td>Table cell</td>
|
||||
<td>Table cell</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">2</th>
|
||||
<td>Table cell</td>
|
||||
<td>Table cell</td>
|
||||
<td>Table cell</td>
|
||||
<td>Table cell</td>
|
||||
<td>Table cell</td>
|
||||
<td>Table cell</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">3</th>
|
||||
<td>Table cell</td>
|
||||
<td>Table cell</td>
|
||||
<td>Table cell</td>
|
||||
<td>Table cell</td>
|
||||
<td>Table cell</td>
|
||||
<td>Table cell</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
{% highlight html %}
|
||||
<div class="table-responsive">
|
||||
<table class="table">
|
||||
...
|
||||
</table>
|
||||
</div>
|
||||
<table class="table table-responsive"">
|
||||
...
|
||||
</table>
|
||||
{% endhighlight %}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ description: Documentation and examples for Bootstrap typography, including glob
|
|||
group: content
|
||||
---
|
||||
|
||||
Bootstrap includes simple and easily customized typography for headings, body text, lists, and more. For even more control, check out the [textual utility classes]({{ site.baseurl }}/utilities/).
|
||||
Bootstrap includes simple and easily customized typography for headings, body text, lists, and more. For even more control, check out the [textual utility classes]({{ site.baseurl }}/utilities/typography).
|
||||
|
||||
## Contents
|
||||
|
||||
|
|
@ -154,7 +154,7 @@ Change text alignment, transform, style, weight, and color with our [text utilit
|
|||
|
||||
## Abbreviations
|
||||
|
||||
Stylized implementation of HTML's `<abbr>` element for abbreviations and acronyms to show the expanded version on hover. Abbreviations with a `title` attribute have a light dotted bottom border and a help cursor on hover, providing additional context on hover and to users of assistive technologies.
|
||||
Stylized implementation of HTML's `<abbr>` element for abbreviations and acronyms to show the expanded version on hover. Abbreviations have a default underline from Normalize.css and gain a help cursor to provide additional context on hover and to users of assistive technologies.
|
||||
|
||||
Add `.initialism` to an abbreviation for a slightly smaller font-size.
|
||||
|
||||
|
|
|
|||
7203
docs/dist/css/bootstrap-flex.css
vendored
7203
docs/dist/css/bootstrap-flex.css
vendored
File diff suppressed because it is too large
Load diff
BIN
docs/dist/css/bootstrap-flex.css.map
vendored
BIN
docs/dist/css/bootstrap-flex.css.map
vendored
Binary file not shown.
7
docs/dist/css/bootstrap-flex.min.css
vendored
7
docs/dist/css/bootstrap-flex.min.css
vendored
File diff suppressed because one or more lines are too long
BIN
docs/dist/css/bootstrap-flex.min.css.map
vendored
BIN
docs/dist/css/bootstrap-flex.min.css.map
vendored
Binary file not shown.
721
docs/dist/css/bootstrap-grid.css
vendored
721
docs/dist/css/bootstrap-grid.css
vendored
File diff suppressed because it is too large
Load diff
BIN
docs/dist/css/bootstrap-grid.css.map
vendored
BIN
docs/dist/css/bootstrap-grid.css.map
vendored
Binary file not shown.
3
docs/dist/css/bootstrap-grid.min.css
vendored
3
docs/dist/css/bootstrap-grid.min.css
vendored
File diff suppressed because one or more lines are too long
BIN
docs/dist/css/bootstrap-grid.min.css.map
vendored
BIN
docs/dist/css/bootstrap-grid.min.css.map
vendored
Binary file not shown.
132
docs/dist/css/bootstrap-reboot.css
vendored
132
docs/dist/css/bootstrap-reboot.css
vendored
|
|
@ -1,4 +1,4 @@
|
|||
/*! normalize.css v4.2.0 | MIT License | github.com/necolas/normalize.css */
|
||||
/*! normalize.css v5.0.0 | MIT License | github.com/necolas/normalize.css */
|
||||
html {
|
||||
font-family: sans-serif;
|
||||
line-height: 1.15;
|
||||
|
|
@ -12,38 +12,38 @@ body {
|
|||
|
||||
article,
|
||||
aside,
|
||||
details,
|
||||
figcaption,
|
||||
figure,
|
||||
footer,
|
||||
header,
|
||||
main,
|
||||
menu,
|
||||
nav,
|
||||
section,
|
||||
summary {
|
||||
section {
|
||||
display: block;
|
||||
}
|
||||
|
||||
audio,
|
||||
canvas,
|
||||
progress,
|
||||
video {
|
||||
display: inline-block;
|
||||
h1 {
|
||||
font-size: 2em;
|
||||
margin: 0.67em 0;
|
||||
}
|
||||
|
||||
audio:not([controls]) {
|
||||
display: none;
|
||||
figcaption,
|
||||
figure,
|
||||
main {
|
||||
display: block;
|
||||
}
|
||||
|
||||
figure {
|
||||
margin: 1em 40px;
|
||||
}
|
||||
|
||||
hr {
|
||||
-webkit-box-sizing: content-box;
|
||||
box-sizing: content-box;
|
||||
height: 0;
|
||||
overflow: visible;
|
||||
}
|
||||
|
||||
progress {
|
||||
vertical-align: baseline;
|
||||
}
|
||||
|
||||
template,
|
||||
[hidden] {
|
||||
display: none;
|
||||
pre {
|
||||
font-family: monospace, monospace;
|
||||
font-size: 1em;
|
||||
}
|
||||
|
||||
a {
|
||||
|
|
@ -72,13 +72,15 @@ strong {
|
|||
font-weight: bolder;
|
||||
}
|
||||
|
||||
dfn {
|
||||
font-style: italic;
|
||||
code,
|
||||
kbd,
|
||||
samp {
|
||||
font-family: monospace, monospace;
|
||||
font-size: 1em;
|
||||
}
|
||||
|
||||
h1 {
|
||||
font-size: 2em;
|
||||
margin: 0.67em 0;
|
||||
dfn {
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
mark {
|
||||
|
|
@ -106,6 +108,16 @@ sup {
|
|||
top: -0.5em;
|
||||
}
|
||||
|
||||
audio,
|
||||
video {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
audio:not([controls]) {
|
||||
display: none;
|
||||
height: 0;
|
||||
}
|
||||
|
||||
img {
|
||||
border-style: none;
|
||||
}
|
||||
|
|
@ -114,38 +126,17 @@ svg:not(:root) {
|
|||
overflow: hidden;
|
||||
}
|
||||
|
||||
code,
|
||||
kbd,
|
||||
pre,
|
||||
samp {
|
||||
font-family: monospace, monospace;
|
||||
font-size: 1em;
|
||||
}
|
||||
|
||||
figure {
|
||||
margin: 1em 40px;
|
||||
}
|
||||
|
||||
hr {
|
||||
-webkit-box-sizing: content-box;
|
||||
box-sizing: content-box;
|
||||
height: 0;
|
||||
overflow: visible;
|
||||
}
|
||||
|
||||
button,
|
||||
input,
|
||||
optgroup,
|
||||
select,
|
||||
textarea {
|
||||
font: inherit;
|
||||
font-family: sans-serif;
|
||||
font-size: 100%;
|
||||
line-height: 1.15;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
optgroup {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
button,
|
||||
input {
|
||||
overflow: visible;
|
||||
|
|
@ -194,6 +185,11 @@ legend {
|
|||
white-space: normal;
|
||||
}
|
||||
|
||||
progress {
|
||||
display: inline-block;
|
||||
vertical-align: baseline;
|
||||
}
|
||||
|
||||
textarea {
|
||||
overflow: auto;
|
||||
}
|
||||
|
|
@ -220,16 +216,32 @@ textarea {
|
|||
-webkit-appearance: none;
|
||||
}
|
||||
|
||||
::-webkit-input-placeholder {
|
||||
color: inherit;
|
||||
opacity: 0.54;
|
||||
}
|
||||
|
||||
::-webkit-file-upload-button {
|
||||
-webkit-appearance: button;
|
||||
font: inherit;
|
||||
}
|
||||
|
||||
details,
|
||||
menu {
|
||||
display: block;
|
||||
}
|
||||
|
||||
summary {
|
||||
display: list-item;
|
||||
}
|
||||
|
||||
canvas {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
template {
|
||||
display: none;
|
||||
}
|
||||
|
||||
[hidden] {
|
||||
display: none;
|
||||
}
|
||||
|
||||
html {
|
||||
-webkit-box-sizing: border-box;
|
||||
box-sizing: border-box;
|
||||
|
|
@ -253,10 +265,11 @@ html {
|
|||
}
|
||||
|
||||
body {
|
||||
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
|
||||
font-family: -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
|
||||
font-size: 1rem;
|
||||
font-weight: normal;
|
||||
line-height: 1.5;
|
||||
color: #373a3c;
|
||||
color: #292b2c;
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
|
|
@ -277,7 +290,6 @@ p {
|
|||
abbr[title],
|
||||
abbr[data-original-title] {
|
||||
cursor: help;
|
||||
border-bottom: 1px dotted #818a91;
|
||||
}
|
||||
|
||||
address {
|
||||
|
|
@ -381,7 +393,7 @@ table {
|
|||
caption {
|
||||
padding-top: 0.75rem;
|
||||
padding-bottom: 0.75rem;
|
||||
color: #818a91;
|
||||
color: #636c72;
|
||||
text-align: left;
|
||||
caption-side: bottom;
|
||||
}
|
||||
|
|
|
|||
BIN
docs/dist/css/bootstrap-reboot.css.map
vendored
BIN
docs/dist/css/bootstrap-reboot.css.map
vendored
Binary file not shown.
3
docs/dist/css/bootstrap-reboot.min.css
vendored
3
docs/dist/css/bootstrap-reboot.min.css
vendored
|
|
@ -1,2 +1 @@
|
|||
/*! normalize.css v4.2.0 | MIT License | github.com/necolas/normalize.css */html{font-family:sans-serif;line-height:1.15;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}body{margin:0}article,aside,details,figcaption,figure,footer,header,main,menu,nav,section,summary{display:block}audio,canvas,progress,video{display:inline-block}audio:not([controls]){display:none;height:0}progress{vertical-align:baseline}[hidden],template{display:none}a{background-color:transparent;-webkit-text-decoration-skip:objects}a:active,a:hover{outline-width:0}abbr[title]{border-bottom:none;text-decoration:underline;text-decoration:underline dotted}b,strong{font-weight:inherit}b,strong{font-weight:bolder}dfn{font-style:italic}h1{font-size:2em;margin:.67em 0}mark{background-color:#ff0;color:#000}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}img{border-style:none}svg:not(:root){overflow:hidden}code,kbd,pre,samp{font-family:monospace,monospace;font-size:1em}figure{margin:1em 40px}hr{-webkit-box-sizing:content-box;box-sizing:content-box;height:0;overflow:visible}button,input,optgroup,select,textarea{font:inherit;margin:0}optgroup{font-weight:700}button,input{overflow:visible}button,select{text-transform:none}[type=reset],[type=submit],button,html [type=button]{-webkit-appearance:button}[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner,button::-moz-focus-inner{border-style:none;padding:0}[type=button]:-moz-focusring,[type=reset]:-moz-focusring,[type=submit]:-moz-focusring,button:-moz-focusring{outline:1px dotted ButtonText}fieldset{border:1px solid silver;margin:0 2px;padding:.35em .625em .75em}legend{-webkit-box-sizing:border-box;box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal}textarea{overflow:auto}[type=checkbox],[type=radio]{-webkit-box-sizing:border-box;box-sizing:border-box;padding:0}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}[type=search]::-webkit-search-cancel-button,[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-input-placeholder{color:inherit;opacity:.54}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}html{-webkit-box-sizing:border-box;box-sizing:border-box}*,::after,::before{-webkit-box-sizing:inherit;box-sizing:inherit}@-ms-viewport{width:device-width}html{font-size:16px;-ms-overflow-style:scrollbar;-webkit-tap-highlight-color:transparent}body{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;font-size:1rem;line-height:1.5;color:#373a3c;background-color:#fff}[tabindex="-1"]:focus{outline:0!important}h1,h2,h3,h4,h5,h6{margin-top:0;margin-bottom:.5rem}p{margin-top:0;margin-bottom:1rem}abbr[data-original-title],abbr[title]{cursor:help;border-bottom:1px dotted #818a91}address{margin-bottom:1rem;font-style:normal;line-height:inherit}dl,ol,ul{margin-top:0;margin-bottom:1rem}ol ol,ol ul,ul ol,ul ul{margin-bottom:0}dt{font-weight:700}dd{margin-bottom:.5rem;margin-left:0}blockquote{margin:0 0 1rem}a{color:#0275d8;text-decoration:none}a:focus,a:hover{color:#014c8c;text-decoration:underline}a:focus{outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}a:not([href]):not([tabindex]){color:inherit;text-decoration:none}a:not([href]):not([tabindex]):focus,a:not([href]):not([tabindex]):hover{color:inherit;text-decoration:none}a:not([href]):not([tabindex]):focus{outline:0}pre{margin-top:0;margin-bottom:1rem;overflow:auto}figure{margin:0 0 1rem}img{vertical-align:middle}[role=button]{cursor:pointer}[role=button],a,area,button,input,label,select,summary,textarea{-ms-touch-action:manipulation;touch-action:manipulation}table{border-collapse:collapse;background-color:transparent}caption{padding-top:.75rem;padding-bottom:.75rem;color:#818a91;text-align:left;caption-side:bottom}th{text-align:left}label{display:inline-block;margin-bottom:.5rem}button:focus{outline:1px dotted;outline:5px auto -webkit-focus-ring-color}button,input,select,textarea{line-height:inherit}input[type=checkbox]:disabled,input[type=radio]:disabled{cursor:not-allowed}input[type=date],input[type=time],input[type=datetime-local],input[type=month]{-webkit-appearance:listbox}textarea{resize:vertical}fieldset{min-width:0;padding:0;margin:0;border:0}legend{display:block;width:100%;padding:0;margin-bottom:.5rem;font-size:1.5rem;line-height:inherit}input[type=search]{-webkit-appearance:none}output{display:inline-block}[hidden]{display:none!important}
|
||||
/*# sourceMappingURL=bootstrap-reboot.min.css.map */
|
||||
/*! normalize.css v5.0.0 | MIT License | github.com/necolas/normalize.css */html{font-family:sans-serif;line-height:1.15;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}body{margin:0}article,aside,footer,header,nav,section{display:block}h1{font-size:2em;margin:.67em 0}figcaption,figure,main{display:block}figure{margin:1em 40px}hr{-webkit-box-sizing:content-box;box-sizing:content-box;height:0;overflow:visible}pre{font-family:monospace,monospace;font-size:1em}a{background-color:transparent;-webkit-text-decoration-skip:objects}a:active,a:hover{outline-width:0}abbr[title]{border-bottom:none;text-decoration:underline;text-decoration:underline dotted}b,strong{font-weight:inherit}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace,monospace;font-size:1em}dfn{font-style:italic}mark{background-color:#ff0;color:#000}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}audio,video{display:inline-block}audio:not([controls]){display:none;height:0}img{border-style:none}svg:not(:root){overflow:hidden}button,input,optgroup,select,textarea{font-family:sans-serif;font-size:100%;line-height:1.15;margin:0}button,input{overflow:visible}button,select{text-transform:none}[type=reset],[type=submit],button,html [type=button]{-webkit-appearance:button}[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner,button::-moz-focus-inner{border-style:none;padding:0}[type=button]:-moz-focusring,[type=reset]:-moz-focusring,[type=submit]:-moz-focusring,button:-moz-focusring{outline:1px dotted ButtonText}fieldset{border:1px solid silver;margin:0 2px;padding:.35em .625em .75em}legend{-webkit-box-sizing:border-box;box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal}progress{display:inline-block;vertical-align:baseline}textarea{overflow:auto}[type=checkbox],[type=radio]{-webkit-box-sizing:border-box;box-sizing:border-box;padding:0}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}[type=search]::-webkit-search-cancel-button,[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}details,menu{display:block}summary{display:list-item}canvas{display:inline-block}template{display:none}[hidden]{display:none}html{-webkit-box-sizing:border-box;box-sizing:border-box}*,::after,::before{-webkit-box-sizing:inherit;box-sizing:inherit}@-ms-viewport{width:device-width}html{font-size:16px;-ms-overflow-style:scrollbar;-webkit-tap-highlight-color:transparent}body{font-family:-apple-system,system-ui,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;font-size:1rem;font-weight:400;line-height:1.5;color:#292b2c;background-color:#fff}[tabindex="-1"]:focus{outline:0!important}h1,h2,h3,h4,h5,h6{margin-top:0;margin-bottom:.5rem}p{margin-top:0;margin-bottom:1rem}abbr[data-original-title],abbr[title]{cursor:help}address{margin-bottom:1rem;font-style:normal;line-height:inherit}dl,ol,ul{margin-top:0;margin-bottom:1rem}ol ol,ol ul,ul ol,ul ul{margin-bottom:0}dt{font-weight:700}dd{margin-bottom:.5rem;margin-left:0}blockquote{margin:0 0 1rem}a{color:#0275d8;text-decoration:none}a:focus,a:hover{color:#014c8c;text-decoration:underline}a:focus{outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}a:not([href]):not([tabindex]){color:inherit;text-decoration:none}a:not([href]):not([tabindex]):focus,a:not([href]):not([tabindex]):hover{color:inherit;text-decoration:none}a:not([href]):not([tabindex]):focus{outline:0}pre{margin-top:0;margin-bottom:1rem;overflow:auto}figure{margin:0 0 1rem}img{vertical-align:middle}[role=button]{cursor:pointer}[role=button],a,area,button,input,label,select,summary,textarea{-ms-touch-action:manipulation;touch-action:manipulation}table{border-collapse:collapse;background-color:transparent}caption{padding-top:.75rem;padding-bottom:.75rem;color:#636c72;text-align:left;caption-side:bottom}th{text-align:left}label{display:inline-block;margin-bottom:.5rem}button:focus{outline:1px dotted;outline:5px auto -webkit-focus-ring-color}button,input,select,textarea{line-height:inherit}input[type=checkbox]:disabled,input[type=radio]:disabled{cursor:not-allowed}input[type=date],input[type=time],input[type=datetime-local],input[type=month]{-webkit-appearance:listbox}textarea{resize:vertical}fieldset{min-width:0;padding:0;margin:0;border:0}legend{display:block;width:100%;padding:0;margin-bottom:.5rem;font-size:1.5rem;line-height:inherit}input[type=search]{-webkit-appearance:none}output{display:inline-block}[hidden]{display:none!important}/*# sourceMappingURL=bootstrap-reboot.min.css.map */
|
||||
BIN
docs/dist/css/bootstrap-reboot.min.css.map
vendored
BIN
docs/dist/css/bootstrap-reboot.min.css.map
vendored
Binary file not shown.
File diff suppressed because it is too large
Load diff
BIN
docs/dist/css/bootstrap.css.map
vendored
BIN
docs/dist/css/bootstrap.css.map
vendored
Binary file not shown.
5
docs/dist/css/bootstrap.min.css
vendored
5
docs/dist/css/bootstrap.min.css
vendored
File diff suppressed because one or more lines are too long
BIN
docs/dist/css/bootstrap.min.css.map
vendored
BIN
docs/dist/css/bootstrap.min.css.map
vendored
Binary file not shown.
File diff suppressed because it is too large
Load diff
6
docs/dist/js/bootstrap.min.js
vendored
6
docs/dist/js/bootstrap.min.js
vendored
File diff suppressed because one or more lines are too long
|
|
@ -6,33 +6,6 @@ body {
|
|||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.navbar-collapse .container-fluid {
|
||||
padding: 2rem 2.5rem;
|
||||
border-bottom: 1px solid #55595c;
|
||||
}
|
||||
|
||||
.navbar-collapse h4 {
|
||||
color: #818a91;
|
||||
}
|
||||
|
||||
.navbar-collapse .text-muted {
|
||||
color: #818a91;
|
||||
}
|
||||
|
||||
.about {
|
||||
float: left;
|
||||
max-width: 30rem;
|
||||
margin-right: 3rem;
|
||||
}
|
||||
|
||||
.social a {
|
||||
font-weight: 500;
|
||||
color: #eceeef;
|
||||
}
|
||||
.social a:hover {
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.jumbotron {
|
||||
padding-top: 6rem;
|
||||
padding-bottom: 6rem;
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@
|
|||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
|
||||
<meta name="description" content="">
|
||||
<meta name="author" content="">
|
||||
<link rel="icon" href="../../favicon.ico">
|
||||
|
|
@ -19,30 +20,34 @@
|
|||
|
||||
<body>
|
||||
|
||||
<div class="navbar-collapse collapse inverse" id="navbar-header">
|
||||
<div class="container-fluid">
|
||||
<div class="about">
|
||||
<h4>About</h4>
|
||||
<p class="text-muted">Add some information about the album below, the author, or any other background context. Make it a few sentences long so folks can pick up some informative tidbits. Then, link them off to some social networking sites or contact information.</p>
|
||||
</div>
|
||||
<div class="social">
|
||||
<h4>Contact</h4>
|
||||
<ul class="list-unstyled">
|
||||
<li><a href="#">Follow on Twitter</a></li>
|
||||
<li><a href="#">Like on Facebook</a></li>
|
||||
<li><a href="#">Email me</a></li>
|
||||
</ul>
|
||||
<div class="collapse bg-inverse" id="navbarHeader">
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-sm-8 py-4">
|
||||
<h4 class="text-white">About</h4>
|
||||
<p class="text-muted">Add some information about the album below, the author, or any other background context. Make it a few sentences long so folks can pick up some informative tidbits. Then, link them off to some social networking sites or contact information.</p>
|
||||
</div>
|
||||
<div class="col-sm-4 py-4">
|
||||
<h4 class="text-white">Contact</h4>
|
||||
<ul class="list-unstyled">
|
||||
<li><a href="#" class="text-white">Follow on Twitter</a></li>
|
||||
<li><a href="#" class="text-white">Like on Facebook</a></li>
|
||||
<li><a href="#" class="text-white">Email me</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="navbar navbar-static-top navbar-dark bg-inverse">
|
||||
<div class="container-fluid">
|
||||
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbar-header" aria-controls="navbar-header" aria-expanded="false" aria-label="Toggle navigation"></button>
|
||||
<div class="navbar navbar-inverse bg-inverse">
|
||||
<div class="container d-flex justify-content-between">
|
||||
<a href="#" class="navbar-brand">Album</a>
|
||||
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarHeader" aria-controls="navbarHeader" aria-expanded="false" aria-label="Toggle navigation">
|
||||
<span class="navbar-toggler-icon"></span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<section class="jumbotron text-xs-center">
|
||||
<section class="jumbotron text-center">
|
||||
<div class="container">
|
||||
<h1 class="jumbotron-heading">Album example</h1>
|
||||
<p class="lead text-muted">Something short and leading about the collection below—its contents, the creator, etc. Make it short and sweet, but not too short so folks don't simply skip over it entirely.</p>
|
||||
|
|
@ -102,7 +107,7 @@
|
|||
|
||||
<footer class="text-muted">
|
||||
<div class="container">
|
||||
<p class="float-xs-right">
|
||||
<p class="float-right">
|
||||
<a href="#">Back to top</a>
|
||||
</p>
|
||||
<p>Album example is © Bootstrap, but please download and customize it for yourself!</p>
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@
|
|||
/* Padding below the footer and lighter body text */
|
||||
|
||||
body {
|
||||
padding-top: 3rem;
|
||||
padding-bottom: 3rem;
|
||||
color: #5a5a5a;
|
||||
}
|
||||
|
|
@ -18,6 +19,7 @@ body {
|
|||
/* Since positioning the image, we need to help out the caption */
|
||||
.carousel-caption {
|
||||
z-index: 10;
|
||||
bottom: 3rem;
|
||||
}
|
||||
|
||||
/* Declare heights because of positioning of img element */
|
||||
|
|
@ -33,19 +35,6 @@ body {
|
|||
height: 32rem;
|
||||
}
|
||||
|
||||
.carousel-indicators {
|
||||
top: 1.5rem;
|
||||
right: 1.5rem;
|
||||
bottom: auto;
|
||||
left: auto;
|
||||
width: 1rem;
|
||||
margin-left: 0;
|
||||
}
|
||||
|
||||
.carousel-indicators > li {
|
||||
margin-bottom: .25rem;
|
||||
}
|
||||
|
||||
|
||||
/* MARKETING CONTENT
|
||||
-------------------------------------------------- */
|
||||
|
|
|
|||
|
|
@ -19,29 +19,31 @@
|
|||
</head>
|
||||
<body>
|
||||
|
||||
<nav class="navbar navbar-static-top navbar-light bg-faded">
|
||||
<a href="#" class="navbar-brand">Carousel</a>
|
||||
<ul class="nav navbar-nav">
|
||||
<li class="nav-item active">
|
||||
<a class="nav-link" href="#">Home <span class="sr-only">(current)</span></a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="#">Features</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="#">Pricing</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="#">About</a>
|
||||
</li>
|
||||
</ul>
|
||||
<nav class="navbar navbar-toggleable-md navbar-inverse navbar-fixed-top bg-inverse">
|
||||
<button class="navbar-toggler navbar-toggler-right" type="button" data-toggle="collapse" data-target="#navbarCollapse" aria-controls="navbarCollapse" aria-expanded="false" aria-label="Toggle navigation">
|
||||
<span class="navbar-toggler-icon"></span>
|
||||
</button>
|
||||
<a class="navbar-brand" href="#">Carousel</a>
|
||||
<div class="collapse navbar-collapse" id="navbarCollapse">
|
||||
<ul class="navbar-nav mr-auto">
|
||||
<li class="nav-item active">
|
||||
<a class="nav-link" href="#">Home <span class="sr-only">(current)</span></a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="#">Link</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link disabled" href="#">Disabled</a>
|
||||
</li>
|
||||
</ul>
|
||||
<form class="form-inline mt-2 mt-md-0">
|
||||
<input class="form-control mr-sm-2" type="text" placeholder="Search">
|
||||
<button class="btn btn-outline-success my-2 my-sm-0" type="submit">Search</button>
|
||||
</form>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
|
||||
<!-- Carousel
|
||||
================================================== -->
|
||||
<div id="myCarousel" class="carousel slide" data-ride="carousel">
|
||||
<!-- Indicators -->
|
||||
<ol class="carousel-indicators">
|
||||
<li data-target="#myCarousel" data-slide-to="0" class="active"></li>
|
||||
<li data-target="#myCarousel" data-slide-to="1"></li>
|
||||
|
|
@ -51,7 +53,7 @@
|
|||
<div class="carousel-item active">
|
||||
<img class="first-slide" src="data:image/gif;base64,R0lGODlhAQABAIAAAHd3dwAAACH5BAAAAAAALAAAAAABAAEAAAICRAEAOw==" alt="First slide">
|
||||
<div class="container">
|
||||
<div class="carousel-caption text-xs-left">
|
||||
<div class="carousel-caption d-none d-md-block text-left">
|
||||
<h1>Example headline.</h1>
|
||||
<p>Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec id elit non mi porta gravida at eget metus. Nullam id dolor id nibh ultricies vehicula ut id elit.</p>
|
||||
<p><a class="btn btn-lg btn-primary" href="#" role="button">Sign up today</a></p>
|
||||
|
|
@ -61,7 +63,7 @@
|
|||
<div class="carousel-item">
|
||||
<img class="second-slide" src="data:image/gif;base64,R0lGODlhAQABAIAAAHd3dwAAACH5BAAAAAAALAAAAAABAAEAAAICRAEAOw==" alt="Second slide">
|
||||
<div class="container">
|
||||
<div class="carousel-caption">
|
||||
<div class="carousel-caption d-none d-md-block">
|
||||
<h1>Another example headline.</h1>
|
||||
<p>Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec id elit non mi porta gravida at eget metus. Nullam id dolor id nibh ultricies vehicula ut id elit.</p>
|
||||
<p><a class="btn btn-lg btn-primary" href="#" role="button">Learn more</a></p>
|
||||
|
|
@ -71,7 +73,7 @@
|
|||
<div class="carousel-item">
|
||||
<img class="third-slide" src="data:image/gif;base64,R0lGODlhAQABAIAAAHd3dwAAACH5BAAAAAAALAAAAAABAAEAAAICRAEAOw==" alt="Third slide">
|
||||
<div class="container">
|
||||
<div class="carousel-caption text-xs-right">
|
||||
<div class="carousel-caption d-none d-md-block text-right">
|
||||
<h1>One more for good measure.</h1>
|
||||
<p>Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec id elit non mi porta gravida at eget metus. Nullam id dolor id nibh ultricies vehicula ut id elit.</p>
|
||||
<p><a class="btn btn-lg btn-primary" href="#" role="button">Browse gallery</a></p>
|
||||
|
|
@ -79,15 +81,15 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<a class="left carousel-control" href="#myCarousel" role="button" data-slide="prev">
|
||||
<span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span>
|
||||
<a class="carousel-control-prev" href="#myCarousel" role="button" data-slide="prev">
|
||||
<span class="carousel-control-prev-icon" aria-hidden="true"></span>
|
||||
<span class="sr-only">Previous</span>
|
||||
</a>
|
||||
<a class="right carousel-control" href="#myCarousel" role="button" data-slide="next">
|
||||
<span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>
|
||||
<a class="carousel-control-next" href="#myCarousel" role="button" data-slide="next">
|
||||
<span class="carousel-control-next-icon" aria-hidden="true"></span>
|
||||
<span class="sr-only">Next</span>
|
||||
</a>
|
||||
</div><!-- /.carousel -->
|
||||
</div>
|
||||
|
||||
|
||||
<!-- Marketing messaging and featurettes
|
||||
|
|
@ -99,19 +101,19 @@
|
|||
<!-- Three columns of text below the carousel -->
|
||||
<div class="row">
|
||||
<div class="col-lg-4">
|
||||
<img class="img-circle" src="data:image/gif;base64,R0lGODlhAQABAIAAAHd3dwAAACH5BAAAAAAALAAAAAABAAEAAAICRAEAOw==" alt="Generic placeholder image" width="140" height="140">
|
||||
<img class="rounded-circle" src="data:image/gif;base64,R0lGODlhAQABAIAAAHd3dwAAACH5BAAAAAAALAAAAAABAAEAAAICRAEAOw==" alt="Generic placeholder image" width="140" height="140">
|
||||
<h2>Heading</h2>
|
||||
<p>Donec sed odio dui. Etiam porta sem malesuada magna mollis euismod. Nullam id dolor id nibh ultricies vehicula ut id elit. Morbi leo risus, porta ac consectetur ac, vestibulum at eros. Praesent commodo cursus magna.</p>
|
||||
<p><a class="btn btn-secondary" href="#" role="button">View details »</a></p>
|
||||
</div><!-- /.col-lg-4 -->
|
||||
<div class="col-lg-4">
|
||||
<img class="img-circle" src="data:image/gif;base64,R0lGODlhAQABAIAAAHd3dwAAACH5BAAAAAAALAAAAAABAAEAAAICRAEAOw==" alt="Generic placeholder image" width="140" height="140">
|
||||
<img class="rounded-circle" src="data:image/gif;base64,R0lGODlhAQABAIAAAHd3dwAAACH5BAAAAAAALAAAAAABAAEAAAICRAEAOw==" alt="Generic placeholder image" width="140" height="140">
|
||||
<h2>Heading</h2>
|
||||
<p>Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit. Cras mattis consectetur purus sit amet fermentum. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh.</p>
|
||||
<p><a class="btn btn-secondary" href="#" role="button">View details »</a></p>
|
||||
</div><!-- /.col-lg-4 -->
|
||||
<div class="col-lg-4">
|
||||
<img class="img-circle" src="data:image/gif;base64,R0lGODlhAQABAIAAAHd3dwAAACH5BAAAAAAALAAAAAABAAEAAAICRAEAOw==" alt="Generic placeholder image" width="140" height="140">
|
||||
<img class="rounded-circle" src="data:image/gif;base64,R0lGODlhAQABAIAAAHd3dwAAACH5BAAAAAAALAAAAAABAAEAAAICRAEAOw==" alt="Generic placeholder image" width="140" height="140">
|
||||
<h2>Heading</h2>
|
||||
<p>Donec sed odio dui. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Vestibulum id ligula porta felis euismod semper. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus.</p>
|
||||
<p><a class="btn btn-secondary" href="#" role="button">View details »</a></p>
|
||||
|
|
@ -164,7 +166,7 @@
|
|||
|
||||
<!-- FOOTER -->
|
||||
<footer>
|
||||
<p class="float-xs-right"><a href="#">Back to top</a></p>
|
||||
<p class="float-right"><a href="#">Back to top</a></p>
|
||||
<p>© 2014 Company, Inc. · <a href="#">Privacy</a> · <a href="#">Terms</a></p>
|
||||
</footer>
|
||||
|
||||
|
|
|
|||
|
|
@ -7,96 +7,64 @@ body {
|
|||
padding-top: 50px;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Global add-ons
|
||||
* Typography
|
||||
*/
|
||||
|
||||
.sub-header {
|
||||
padding-bottom: 10px;
|
||||
h1 {
|
||||
margin-bottom: 20px;
|
||||
padding-bottom: 9px;
|
||||
border-bottom: 1px solid #eee;
|
||||
}
|
||||
|
||||
/*
|
||||
* Top navigation
|
||||
* Hide default border to remove 1px line.
|
||||
*/
|
||||
.navbar-fixed-top {
|
||||
border: 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* Sidebar
|
||||
*/
|
||||
|
||||
/* Hide for mobile, show later */
|
||||
.sidebar {
|
||||
display: none;
|
||||
}
|
||||
@media (min-width: 768px) {
|
||||
.sidebar {
|
||||
position: fixed;
|
||||
top: 51px;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
z-index: 1000;
|
||||
display: block;
|
||||
padding: 20px;
|
||||
overflow-x: hidden;
|
||||
overflow-y: auto; /* Scrollable contents if viewport is shorter than content. */
|
||||
background-color: #f5f5f5;
|
||||
border-right: 1px solid #eee;
|
||||
}
|
||||
position: fixed;
|
||||
top: 51px;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
z-index: 1000;
|
||||
padding: 20px;
|
||||
overflow-x: hidden;
|
||||
overflow-y: auto; /* Scrollable contents if viewport is shorter than content. */
|
||||
border-right: 1px solid #eee;
|
||||
}
|
||||
|
||||
/* Sidebar navigation */
|
||||
.nav-sidebar {
|
||||
margin-right: -21px; /* 20px padding + 1px border */
|
||||
.sidebar {
|
||||
padding-left: 0;
|
||||
padding-right: 0;
|
||||
}
|
||||
|
||||
.sidebar .nav {
|
||||
margin-bottom: 20px;
|
||||
margin-left: -20px;
|
||||
}
|
||||
.nav-sidebar > li > a {
|
||||
padding-right: 20px;
|
||||
padding-left: 20px;
|
||||
}
|
||||
.nav-sidebar > .active > a,
|
||||
.nav-sidebar > .active > a:hover,
|
||||
.nav-sidebar > .active > a:focus {
|
||||
color: #fff;
|
||||
background-color: #428bca;
|
||||
}
|
||||
|
||||
.sidebar .nav-item {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.sidebar .nav-item + .nav-item {
|
||||
margin-left: 0;
|
||||
}
|
||||
|
||||
.sidebar .nav-link {
|
||||
border-radius: 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* Main content
|
||||
*/
|
||||
|
||||
.main {
|
||||
padding: 20px;
|
||||
}
|
||||
@media (min-width: 768px) {
|
||||
.main {
|
||||
padding-right: 40px;
|
||||
padding-left: 40px;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Placeholder dashboard ideas
|
||||
* Dashboard
|
||||
*/
|
||||
|
||||
/* Placeholders */
|
||||
.placeholders {
|
||||
margin-bottom: 30px;
|
||||
text-align: center;
|
||||
}
|
||||
.placeholders h4 {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
.placeholder {
|
||||
margin-bottom: 20px;
|
||||
padding-bottom: 3rem;
|
||||
}
|
||||
|
||||
.placeholder img {
|
||||
display: inline-block;
|
||||
border-radius: 50%;
|
||||
padding-top: 1.5rem;
|
||||
padding-bottom: 1.5rem;
|
||||
}
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue