for multiple
* lines of code. Angle brackets will be escaped in the code for proper rendering.
*
@@ -45,174 +44,175 @@
* @author Michael Haitz
*/
public class CodeBehavior extends Behavior {
- private static final long serialVersionUID = 1L;
+
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * enum that holds all possible languages
+ */
+ public enum Language implements ICssClassNameProvider {
+ DYNAMIC, // use this or don't set a lang for auto detection
+
+ // auto detected
+ BSH, C, CC, CPP, CS, CSH, CYC, CV, HTM, HTML,
+ JAVA, JS, M, MXML, PERL, PL, PM, PY, RB, SH,
+ XHTML, XML, XSL,
+
+ // plugins
+ APOLLO, BASIC, CLJ, CSS, DART, ERLANG, GO, HS, LISP,
+ LLVM, LUA, MATLAB, ML, MUMPS, N, PASCAL, PROTO, R, RD,
+ SCALA, SQL, TCL, TEX, VB, VHDL, WIKI, XQ, YAML;
+
+ @Override
+ public String cssClassName() {
+ if (!DYNAMIC.equals(this)) {
+ return "lang-" + name().toLowerCase();
+ }
+
+ return "";
+ }
+
+ }
+
+ private final IModel lineNumbers;
+ private final IModel cssClassNameModel;
+ private final IModel language;
+ private final IModel from;
+
+ private final CssClassNameAppender cssClassNameAppender;
+
+ /**
+ * Constructor.
+ */
+ public CodeBehavior() {
+ super();
+
+ lineNumbers = Model.of(false);
+ cssClassNameModel = Model.of("");
+ language = Model.of(Language.DYNAMIC);
+ from = Model.of(0);
+
+ cssClassNameAppender = new CssClassNameAppender(cssClassNameModel);
+ }
+
+ @Override
+ public void detach(Component component) {
+ super.detach(component);
+
+ lineNumbers.detach();
+ cssClassNameModel.detach();
+ language.detach();
+ from.detach();
+ }
+
+ @Override
+ public void renderHead(final Component component, final IHeaderResponse response) {
+ super.renderHead(component, response);
+
+ response.render(CssHeaderItem.forReference(PrettifyCssResourceReference.INSTANCE));
+
+ References.renderWithFilter(Bootstrap.getSettings(), response, JavaScriptHeaderItem.forReference(PrettifyJavaScriptReference.INSTANCE));
+
+ response.render(OnDomReadyHeaderItem.forScript(createInitializerScript(Strings2.getMarkupId(component))));
+ }
+
+ private CharSequence createInitializerScript(CharSequence markupId) {
+ return "$('#" + markupId + "').html(PR.prettyPrintOne($('#" + markupId + "').html(), '', $('#" + markupId + "').attr('class')));";
+ }
+
+ @Override
+ public void bind(final Component component) {
+ super.bind(component);
+
+ BootstrapBaseBehavior.addTo(component);
+ component.add(cssClassNameAppender);
+ }
+
+ @Override
+ public void unbind(final Component component) {
+ super.unbind(component);
+
+ BootstrapBaseBehavior.removeFrom(component);
+ component.remove(cssClassNameAppender);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public void onConfigure(final Component component) {
+ super.onConfigure(component);
+
+ cssClassNameModel.setObject(createCssClassNames());
+ }
+
+ /**
+ * @return a list of css class names
+ */
+ private String createCssClassNames() {
+ return CssClassNames.parse("prettyprint").add(
+ createLineNumbersCssClass(),
+ language.getObject().cssClassName()).asString();
+ }
+
+ /**
+ * @return the css class name for the line number class
+ */
+ private String createLineNumbersCssClass() {
+ if (hasLineNumbers()) {
+ return "linenums" + (from.getObject() > 0 ? ":" + from.getObject() : "");
+ }
+
+ return "";
+ }
+
+ /**
+ * @return true, if line numbers will be rendered
+ */
+ public final boolean hasLineNumbers() {
+ return lineNumbers.getObject();
+ }
+
+ /**
+ * adds line numbers on the left side of code block.
+ *
+ * @return this instance
+ */
+ public final CodeBehavior setShowLineNumbers(final boolean showLineNumbers) {
+ this.lineNumbers.setObject(showLineNumbers);
+
+ return this;
+ }
+
+ /**
+ * defines from which line number the counting will start.
+ *
+ * @param from which line the numbers will count
+ * @return this instance
+ */
+ public final CodeBehavior setStartFromLine(final int from) {
+ setShowLineNumbers(true);
+ this.from.setObject(from);
+
+ return this;
+ }
/**
- * enum that holds all possible languages
- */
- public enum Language implements ICssClassNameProvider {
- DYNAMIC, // use this or don't set a lang for auto detection
-
- // auto detected
- BSH, C, CC, CPP, CS, CSH, CYC, CV, HTM, HTML,
- JAVA, JS, M, MXML, PERL, PL, PM, PY, RB, SH,
- XHTML, XML, XSL,
-
- // plugins
- APOLLO, BASIC, CLJ, CSS, DART, ERLANG, GO, HS, LISP,
- LLVM, LUA, MATLAB, ML, MUMPS, N, PASCAL, PROTO, R, RD,
- SCALA, SQL, TCL, TEX, VB, VHDL, WIKI, XQ, YAML;
-
- @Override
- public String cssClassName() {
- if (!DYNAMIC.equals(this)) {
- return "lang-" + name().toLowerCase();
- }
-
- return "";
- }
-
- }
-
- private final IModel lineNumbers;
- private final IModel cssClassNameModel;
- private final IModel language;
- private final IModel from;
-
- private final CssClassNameAppender cssClassNameAppender;
-
- /**
- * Constructor.
- */
- public CodeBehavior() {
- super();
-
- lineNumbers = Model.of(false);
- cssClassNameModel = Model.of("");
- language = Model.of(Language.DYNAMIC);
- from = Model.of(0);
-
- cssClassNameAppender = new CssClassNameAppender(cssClassNameModel);
- }
-
- @Override
- public void detach(Component component) {
- super.detach(component);
-
- lineNumbers.detach();
- cssClassNameModel.detach();
- language.detach();
- from.detach();
- }
-
- @Override
- public void renderHead(final Component component, final IHeaderResponse response) {
- super.renderHead(component, response);
-
- response.render(CssHeaderItem.forReference(PrettifyCssResourceReference.INSTANCE));
-
- References.renderWithFilter(Bootstrap.getSettings(), response, JavaScriptHeaderItem.forReference(PrettifyJavaScriptReference.INSTANCE));
-
- response.render(OnDomReadyHeaderItem.forScript(createInitializerScript(Strings2.getMarkupId(component))));
- }
-
- private CharSequence createInitializerScript(CharSequence markupId) {
- return "$('#" + markupId + "').html(PR.prettyPrintOne($('#" + markupId + "').html().replace(/\\r\\n|\\r|\\n/g,' '), '', $('#" + markupId + "').attr('class')));";
- }
-
- @Override
- public void bind(final Component component) {
- super.bind(component);
-
- BootstrapBaseBehavior.addTo(component);
- component.add(cssClassNameAppender);
- }
-
- @Override
- public void unbind(final Component component) {
- super.unbind(component);
-
- BootstrapBaseBehavior.removeFrom(component);
- component.remove(cssClassNameAppender);
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public void onConfigure(final Component component) {
- super.onConfigure(component);
-
- cssClassNameModel.setObject(createCssClassNames());
- }
-
- /**
- * @return a list of css class names
- */
- private String createCssClassNames() {
- return CssClassNames.parse("prettyprint").add(
- createLineNumbersCssClass(),
- language.getObject().cssClassName()).asString();
- }
-
- /**
- * @return the css class name for the line number class
- */
- private String createLineNumbersCssClass() {
- if (hasLineNumbers()) {
- return "linenums" + (from.getObject() > 0 ? ":" + from.getObject() : "");
- }
-
- return "";
- }
-
- /**
- * @return true, if line numbers will be rendered
- */
- public final boolean hasLineNumbers() {
- return lineNumbers.getObject();
- }
-
- /**
- * adds line numbers on the left side of code block.
- *
- * @return this instance
- */
- public final CodeBehavior setShowLineNumbers(final boolean showLineNumbers) {
- this.lineNumbers.setObject(showLineNumbers);
-
- return this;
- }
-
- /**
- * defines from which line number the counting will start.
- *
- * @param from which line the numbers will count
- * @return this instance
- */
- public final CodeBehavior setStartFromLine(final int from) {
- setShowLineNumbers(true);
- this.from.setObject(from);
-
- return this;
- }
-
- /**
- * sets the language.
- *
- * @param language the language to use
- * @return this instance
- */
- public final CodeBehavior setLanguage(final Language language) {
- this.language.setObject(language);
-
- return this;
- }
-
- @Override
- public void onComponentTag(Component component, ComponentTag tag) {
- super.onComponentTag(component, tag);
-
- Components.assertTag(component, tag, "code", "pre","xmp");
- }
+ * sets the language.
+ *
+ * @param language the language to use
+ * @return this instance
+ */
+ public final CodeBehavior setLanguage(final Language language) {
+ this.language.setObject(language);
+
+ return this;
+ }
+
+ @Override
+ public void onComponentTag(Component component, ComponentTag tag) {
+ super.onComponentTag(component, tag);
+
+ Components.assertTag(component, tag, "code", "pre", "xmp");
+ }
}
diff --git a/bootstrap-core/src/main/java/de/agilecoders/wicket/core/markup/html/bootstrap/block/Jumbotron.java b/bootstrap-core/src/main/java/de/agilecoders/wicket/core/markup/html/bootstrap/block/Jumbotron.java
index ff7ba2848..47da79717 100644
--- a/bootstrap-core/src/main/java/de/agilecoders/wicket/core/markup/html/bootstrap/block/Jumbotron.java
+++ b/bootstrap-core/src/main/java/de/agilecoders/wicket/core/markup/html/bootstrap/block/Jumbotron.java
@@ -2,30 +2,32 @@
import org.apache.wicket.markup.html.WebMarkupContainer;
import org.apache.wicket.model.IModel;
+import de.agilecoders.wicket.core.markup.html.bootstrap.helpers.TextAndBackgroundColorBehavior.TextAndBackgroundColor;
/**
* #### Description
- *
+ *
* A lightweight, flexible component that can optionally extend the entire viewport to showcase key content on your site.
- *
- * documentation: http://getbootstrap.com/components/#jumbotron
- *
+ *
+ * Jumbotron was removed with Bootstrap 5.0.0.
+ * documentation: https://getbootstrap.com/docs/5.3/migration/#jumbotron
+ *
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante venenatis.
- * Someone famous
- *
+ *
+ *
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante venenatis.
+ * Someone famous
+ *
* ```
- *
+ *
* To make the jumbotron full width, and without rounded corners, place it outside all `.containers` and instead add a
* `.container` within.
- *
+ *
* ```html
*
*
@@ -36,29 +38,41 @@
*
* @author Michael Haitz
*/
+@Deprecated // removed since BS 5.0.0
public class Jumbotron extends WebMarkupContainer {
- /**
- * Constructor.
- *
- * @param componentId The non-null id of a new component
- */
- public Jumbotron(final String componentId) {
- this(componentId, null);
- }
+ private final JumbotronBehavior jumbotronBehavior;
- /**
- * Constructor.
- *
- * @param componentId The non-null id of a new component
- * @param model the component's model
- */
- public Jumbotron(final String componentId, final IModel> model) {
- super(componentId, model);
+ /**
+ * Constructor.
+ *
+ * @param componentId The non-null id of a new component
+ */
+ public Jumbotron(final String componentId) {
+ this(componentId, null);
+ }
- add(new JumbotronBehavior());
- }
+ /**
+ * Constructor.
+ *
+ * @param componentId The non-null id of a new component
+ * @param model the component's model
+ */
+ public Jumbotron(final String componentId, final IModel> model) {
+ super(componentId, model);
+ add(jumbotronBehavior = new JumbotronBehavior());
+ }
+ /**
+ * Sets the TextAndBackground Color.
+ *
+ * @param textAndBackgroundColor the {@link TextAndBackgroundColor}
+ * @return this
+ */
+ public Jumbotron withBackgroundColor(final TextAndBackgroundColor textAndBackgroundColor) {
+ jumbotronBehavior.setTextAndBackgroundColor(textAndBackgroundColor);
+ return this;
+ }
}
diff --git a/bootstrap-core/src/main/java/de/agilecoders/wicket/core/markup/html/bootstrap/block/JumbotronBehavior.java b/bootstrap-core/src/main/java/de/agilecoders/wicket/core/markup/html/bootstrap/block/JumbotronBehavior.java
index 3b16124ef..2fcd336e9 100644
--- a/bootstrap-core/src/main/java/de/agilecoders/wicket/core/markup/html/bootstrap/block/JumbotronBehavior.java
+++ b/bootstrap-core/src/main/java/de/agilecoders/wicket/core/markup/html/bootstrap/block/JumbotronBehavior.java
@@ -1,35 +1,40 @@
package de.agilecoders.wicket.core.markup.html.bootstrap.block;
-import de.agilecoders.wicket.core.markup.html.bootstrap.behavior.BootstrapBaseBehavior;
-import de.agilecoders.wicket.core.util.Attributes;
-import de.agilecoders.wicket.core.util.Components;
+import java.util.Objects;
import org.apache.wicket.Component;
import org.apache.wicket.behavior.Behavior;
import org.apache.wicket.markup.ComponentTag;
+import de.agilecoders.wicket.core.markup.html.bootstrap.behavior.BootstrapBaseBehavior;
+import de.agilecoders.wicket.core.markup.html.bootstrap.helpers.TextAndBackgroundColorBehavior.TextAndBackgroundColor;
+import de.agilecoders.wicket.core.util.Attributes;
+import de.agilecoders.wicket.core.util.Components;
+import de.agilecoders.wicket.core.util.CssClassNames;
+import de.agilecoders.wicket.core.util.CssClassNames.Builder;
/**
* #### Description
- *
+ *
* A lightweight, flexible component that can optionally extend the entire viewport to showcase key content on your site.
- *
- * documentation: http://getbootstrap.com/components/#jumbotron
- *
+ *
+ * Jumbotron was removed with Bootstrap 5.0.0.
+ * documentation: https://getbootstrap.com/docs/5.3/migration/#jumbotron
+ *
All HTML headings, <h1> through <h6> are available.
-
-
-
h1. Heading 1
-
-
h2. Heading 2
-
-
h3. Heading 3
-
h4. Heading 4
-
h5. Heading 5
-
h6. Heading 6
-
-
-
Body copy
-
-
Bootstrap's global default font-size is 14px, with a line-height of 20px. This is applied to the <body> and all paragraphs. In addition, <p> (paragraphs) receive a bottom margin of half their line-height (10px by default).
-
-
-
Nullam quis risus eget urna mollis ornare vel eu leo. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nullam id dolor id nibh ultricies vehicula.
-
-
Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec ullamcorper nulla non metus auctor fringilla. Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit. Donec ullamcorper nulla non metus auctor fringilla.
-
-
Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit.
-
-
<p>...</p>
-
-
Lead body copy
-
-
Make a paragraph stand out by adding .lead.
-
-
-
Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor. Duis mollis, est non commodo luctus.
-
-
<p class="lead">...</p>
-
-
Built with Less
-
-
The typographic scale is based on two LESS variables in variables.less: @baseFontSize and @baseLineHeight. The first is the base font-size used throughout and the second is the base line-height. We use those variables and some simple math to create the margins, paddings, and line-heights of all our type and more. Customize them and Bootstrap adapts.
-
-
-
-
-
-
Emphasis
-
-
Make use of HTML's default emphasis tags with lightweight styles.
-
-
<small>
-
-
For de-emphasizing inline or blocks of text,
- use the small tag.
-
-
-
- This line of text is meant to be treated as fine print.
-
-
-
+
+
+
+
CSS
+
Global CSS settings, fundamental HTML elements styled and enhanced with extensible classes, and an advanced grid system.
All HTML headings, <h1> through <h6> are available.
+
+
+
h1. Heading 1
+
+
h2. Heading 2
+
+
h3. Heading 3
+
h4. Heading 4
+
h5. Heading 5
+
h6. Heading 6
+
+
+
Body copy
+
+
Bootstrap's global default font-size is 14px, with a line-height of
+ 20px. This is applied to the <body> and all paragraphs. In addition,
+ <p>
+ (paragraphs) receive a bottom margin of half their line-height (10px by default).
+
+
+
Nullam quis risus eget urna mollis ornare vel eu leo. Cum sociis natoque penatibus et magnis dis parturient montes,
+ nascetur
+ ridiculus mus. Nullam id dolor id nibh ultricies vehicula.
+
+
Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec ullamcorper nulla non metus
+ auctor
+ fringilla. Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit. Donec
+ ullamcorper
+ nulla non metus auctor fringilla.
+
+
Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Duis
+ mollis,
+ est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit.
+
+
<p>...</p>
+
+
Lead body copy
+
+
Make a paragraph stand out by adding .lead.
+
+
+
Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor. Duis mollis, est non commodo
+ luctus.
+
+
<p class="lead">...</p>
+
+
Built with Less
+
+
The typographic scale is based on two LESS variables in variables.less: @baseFontSize and @baseLineHeight.
+ The first is the base font-size used throughout and the second is the base line-height. We use those variables and some simple
+ math to create the margins, paddings, and line-heights of all our type and more. Customize them and Bootstrap adapts.
+
+
+
+
+
+
Emphasis
+
+
Make use of HTML's default emphasis tags with lightweight styles.
+
+
<small>
+
+
For de-emphasizing inline or blocks of text,
+ use the small tag.
+
+
+
+ This line of text is meant to be treated as fine print.
+
+
+
<p>
<small>This line of text is meant to be treated as fine print.</small>
</p>
-
Bold
+
Bold
-
For emphasizing a snippet of text with a heavier font-weight.
+
For emphasizing a snippet of text with a heavier font-weight.
-
-
The following snippet of text is rendered as bold text.
-
-
<strong>rendered as bold text</strong>
+
+
The following snippet of text is rendered as bold text.
+
+
<strong>rendered as bold text</strong>
-
Italics
+
Italics
-
For emphasizing a snippet of text with italics.
+
For emphasizing a snippet of text with italics.
-
-
The following snippet of text is rendered as italicized text.
-
-
<em>rendered as italicized text</em>
+
+
The following snippet of text is rendered as italicized text.
+
+
<em>rendered as italicized text</em>
-
Heads up! Feel free to use <b> and <i> in HTML5. <b> is meant to highlight words or phrases without conveying additional importance while <i> is mostly for voice, technical terms, etc.
+
Heads up! Feel free to use <b> and <i> in HTML5.
+ <b>
+ is meant to highlight words or phrases without conveying additional importance while <i> is mostly for
+ voice,
+ technical terms, etc.
-
Emphasis classes
+
Emphasis classes
-
Convey meaning through color with a handful of emphasis utility classes.
+
Convey meaning through color with a handful of emphasis utility classes.
-
-
Fusce dapibus, tellus ac cursus commodo, tortor mauris nibh.
+
+
Fusce dapibus, tellus ac cursus commodo, tortor mauris nibh.
-
Etiam porta sem malesuada magna mollis euismod.
+
Etiam porta sem malesuada magna mollis euismod.
-
Donec ullamcorper nulla non metus auctor fringilla.
+
Donec ullamcorper nulla non metus auctor fringilla.
-
Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis.
+
Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis.
-
Duis mollis, est non commodo luctus, nisi erat porttitor ligula.
-
-
+
Duis mollis, est non commodo luctus, nisi erat porttitor ligula.
+
+
<p class="text-muted">Fusce dapibus, tellus ac cursus commodo, tortor mauris nibh.</p>
<p class="text-warning">Etiam porta sem malesuada magna mollis euismod.</p>
<p class="text-error">Donec ullamcorper nulla non metus auctor fringilla.</p>
@@ -160,56 +171,60 @@
Emphasis classes
-
+
-
Abbreviations
+
Abbreviations
-
Stylized implemenation 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.
+
Stylized implemenation 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.
-
<abbr>
+
<abbr>
-
For expanded text on long hover of an abbreviation, include the title attribute.
+
For expanded text on long hover of an abbreviation, include the title attribute.
-
-
An abbreviation of the word attribute is attr.
-
-
<abbr title="attribute">attr</abbr>
+
+
An abbreviation of the word attribute is attr.
+
+
<abbr title="attribute">attr</abbr>
-
<abbr class="initialism">
+
<abbr class="initialism">
-
Add .initialism to an abbreviation for a slightly smaller font-size.
+
Add .initialism to an abbreviation for a slightly smaller font-size.
For quoting blocks of content from another source within your document.
+
For quoting blocks of content from another source within your document.
-
Default blockquote
+
Default blockquote
-
Wrap <blockquote> around any HTML as the quote. For straight quotes we recommend a <p>.
+
Wrap <blockquote> around any HTML as the quote. For straight
+ quotes we recommend a <p>.
-
-
-
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.
-
-
-
+
+
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.
+
+
+
<blockquote class="blockquote">
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.</p>
</blockquote>
-
Blockquote options
+
Blockquote options
-
Style and content changes for simple variations on a standard blockquote.
+
Style and content changes for simple variations on a standard blockquote.
-
Naming a source
+
Naming a source
-
Add <small> tag for identifying the source. Wrap the name of the source work in <cite>.
+
Add <small> tag for identifying the source. Wrap the name of the source work in <cite>.
+
-
-
-
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.
- Someone famous in Source Title
-
-
-
+
+
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.
+ Someone famous in Source Title
+
+
+
<blockquote class="blockquote">
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.</p>
<small>Someone famous <cite title="Source Title">Source Title</cite></small>
</blockquote>
-
Alternate displays
+
Alternate displays
-
Use .pull-right for a floated, right-aligned blockquote.
+
Use .pull-right for a floated, right-aligned blockquote.
-
-
-
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.
- Someone famous in Source Title
-
-
-
+
+
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.
- Heads up!
- Horizontal description lists will truncate terms that are too long to fit in the left column fix text-overflow. In narrower viewports, they will change to the default stacked layout.
-
-
-
-
-
-
-
-
Code
-
-
-
Inline
-
-
Wrap inline snippets of code with <code>.
-
-
- For example, <section> should be wrapped as inline.
-
-
+
+ Heads up!
+ Horizontal description lists will truncate terms that are too long to fit in the left column fix text-overflow.
+ In
+ narrower viewports, they will change to the default stacked layout.
+
+
+
+
+
+
+
+
Code
+
+
+
Inline
+
+
Wrap inline snippets of code with <code>.
+
+
+ For example, <section> should be wrapped as inline.
+
+
For example, <code><section></code> should be wrapped as inline.
-
Basic block
+
Basic block
-
Use <pre> for multiple lines of code. Be sure to escape any angle brackets in the code for proper rendering.
+
Use <pre> for multiple lines of code. Be sure to escape any angle brackets in the code for proper rendering.
+
-
-
<p>Sample text here...</p>
-
-
+
+
<p>Sample text here...</p>
+
+
<pre>
<p>Sample text here...</p>
</pre>
-
Heads up! Be sure to keep code within <pre> tags as close to the left as possible; it will render all tabs.
-
-
You may optionally add the .pre-scrollable class which will set a max-height of 350px and provide a y-axis scrollbar.
-
-
-
-
-
-
-
Tables
-
-
-
Default styles
-
-
For basic styling—light padding and only horizontal dividers—add the base class .table to any <table>.
-
-
-
-
-
-
#
-
First Name
-
Last Name
-
Username
-
-
-
-
-
1
-
Mark
-
Otto
-
@mdo
-
-
-
2
-
Jacob
-
Thornton
-
@fat
-
-
-
3
-
Larry
-
the Bird
-
@twitter
-
-
-
-
-
+
Heads up! Be sure to keep code within <pre> tags as close to the left
+ as
+ possible; it will render all tabs.
+
+
You may optionally add the .pre-scrollable class which will set a max-height of 350px and provide a y-axis
+ scrollbar.
+
+
+
+
+
+
+
+
Tables
+
+
+
Default styles
+
+
For basic styling—light padding and only horizontal dividers—add the base class .table to any <table>.
+
+
+
+
+
+
+
#
+
First Name
+
Last Name
+
Username
+
+
+
+
+
1
+
Mark
+
Otto
+
@mdo
+
+
+
2
+
Jacob
+
Thornton
+
@fat
+
+
+
3
+
Larry
+
the Bird
+
@twitter
+
+
+
+
+
<table class="table">
...
</table>
-
-
-
-
Optional classes
-
-
Add any of the following classes to the .table base class.
-
-
.table-striped
-
-
Adds zebra-striping to any table row within the <tbody> via the :nth-child CSS selector (not available in IE7-IE8).
-
-
-
-
-
-
#
-
First Name
-
Last Name
-
Username
-
-
-
-
-
1
-
Mark
-
Otto
-
@mdo
-
-
-
2
-
Jacob
-
Thornton
-
@fat
-
-
-
3
-
Larry
-
the Bird
-
@twitter
-
-
-
-
-
+
+
+
+
Optional classes
+
+
Add any of the following classes to the .table base class.
+
+
.table-striped
+
+
Adds zebra-striping to any table row within the <tbody> via the :nth-child CSS selector (not
+ available in IE7-IE8).
+
+
+
+
+
+
#
+
First Name
+
Last Name
+
Username
+
+
+
+
+
1
+
Mark
+
Otto
+
@mdo
+
+
+
2
+
Jacob
+
Thornton
+
@fat
+
+
+
3
+
Larry
+
the Bird
+
@twitter
+
+
+
+
+
<table class="table table-striped">
...
</table>
-
.table-bordered
-
-
Add borders and rounded corners to the table.
-
-
-
-
-
-
#
-
First Name
-
Last Name
-
Username
-
-
-
-
-
1
-
Mark
-
Otto
-
@mdo
-
-
-
Mark
-
Otto
-
@TwBootstrap
-
-
-
2
-
Jacob
-
Thornton
-
@fat
-
-
-
3
-
Larry the Bird
-
@twitter
-
-
-
-
-
+
.table-bordered
+
+
Add borders and rounded corners to the table.
+
+
+
+
+
+
#
+
First Name
+
Last Name
+
Username
+
+
+
+
+
1
+
Mark
+
Otto
+
@mdo
+
+
+
Mark
+
Otto
+
@TwBootstrap
+
+
+
2
+
Jacob
+
Thornton
+
@fat
+
+
+
3
+
Larry the Bird
+
@twitter
+
+
+
+
+
<table class="table table-bordered">
...
</table>
-
.table-hover
-
-
Enable a hover state on table rows within a <tbody>.
-
-
-
-
-
-
#
-
First Name
-
Last Name
-
Username
-
-
-
-
-
1
-
Mark
-
Otto
-
@mdo
-
-
-
2
-
Jacob
-
Thornton
-
@fat
-
-
-
3
-
Larry the Bird
-
@twitter
-
-
-
-
-
+
.table-hover
+
+
Enable a hover state on table rows within a <tbody>.
+
+
+
+
+
+
#
+
First Name
+
Last Name
+
Username
+
+
+
+
+
1
+
Mark
+
Otto
+
@mdo
+
+
+
2
+
Jacob
+
Thornton
+
@fat
+
+
+
3
+
Larry the Bird
+
@twitter
+
+
+
+
+
<table class="table table-hover">
...
</table>
-
.table-sm
-
-
Makes tables more compact by cutting cell padding in half.
-
-
-
-
-
-
#
-
First Name
-
Last Name
-
Username
-
-
-
-
-
1
-
Mark
-
Otto
-
@mdo
-
-
-
2
-
Jacob
-
Thornton
-
@fat
-
-
-
3
-
Larry the Bird
-
@twitter
-
-
-
-
-
+
.table-sm
+
+
Makes tables more compact by cutting cell padding in half.
Individual form controls receive styling, but without any required base class on the <form> or large changes in markup. Results in stacked, left-aligned labels on top of form controls.
-
-
-
+
+
+
+
+
+
+
Forms
+
+
+
Default styles
+
+
Individual form controls receive styling, but without any required base class on the <form> or large changes
+ in
+ markup. Results in stacked, left-aligned labels on top of form controls.
Right align labels and float them to the left to make them appear on the same line as controls. Requires the most markup changes from a default form:
-
-
Add .form-horizontal to the form
-
Wrap labels and controls in .form-group
-
Add .control-label to the label
-
Wrap any associated controls in .controls for proper alignment
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
Horizontal form
+
+
Right align labels and float them to the left to make them appear on the same line as controls. Requires the most markup
+ changes
+ from a default form:
+
+
Add .form-horizontal to the form
+
Wrap labels and controls in .form-group
+
Add .control-label to the label
+
Wrap any associated controls in .controls for proper alignment
Examples of standard form controls supported in an example form layout.
+
Examples of standard form controls supported in an example form layout.
-
Inputs
+
Inputs
-
Most common form control, text-based input fields. Includes support for all HTML5 types: text, password, datetime, datetime-local, date, month, time, week, number, email, url, search, tel, and color.
+
Most common form control, text-based input fields. Includes support for all HTML5 types: text, password, datetime,
+ datetime-local,
+ date, month, time, week, number, email, url, search, tel, and color.
-
Requires the use of a specified type at all times.
+
Requires the use of a specified type at all times.
Block level support for help text that appears around form controls.
+
Block level support for help text that appears around form controls.
-
Block help
+
Block help
-
-
-
- A longer block of help text that breaks onto a new line and may extend beyond one line.
-
-
-
+
+
+
+ A longer block of help text that breaks onto a new line and may extend beyond one line.
+
+
+
<input type="text" class="form-control" ><span class="help-block">A longer block of help text that breaks onto a new line and may extend beyond one line.</span>
-
+
-
Form control states
+
Form control states
-
Provide feedback to users or visitors with basic feedback states on form controls and labels.
+
Provide feedback to users or visitors with basic feedback states on form controls and labels.
-
Input focus
+
Input focus
-
We remove the default outline styles on some form controls and apply a box-shadow in its place for :focus.
+
We remove the default outline styles on some form controls and apply a box-shadow in its place for
+ :focus.
+
-
-
-
-
+
+
+
+
<input class="form-control input-lg" id="focusedInput" type="text" value="This is focused...">
-
Disabled inputs
+
Disabled inputs
-
Add the disabled attribute on an input to prevent user input and trigger a slightly different look.
+
Add the disabled attribute on an input to prevent user input and trigger a slightly different look.
Bootstrap includes validation styles for error, warning, info, and success messages. To use, add the appropriate class to the surrounding .form-group.
-
-
-
-
-
-
-
-
- Something may have gone wrong
-
-
-
-
-
-
-
- Please correct the error
-
-
-
-
-
-
-
- Woohoo!
-
-
-
-
-
+
Validation states
+
+
Bootstrap includes validation styles for error, warning, info, and success messages. To use, add the appropriate class to the
+ surrounding .form-group.
Button styles can be applied to anything with the .btn class applied. However, typically you'll want to apply these to only <a> and <button> elements for the best rendering.
-
-
-
-
Button
-
class=""
-
Description
-
-
-
-
-
-
-
-
btn
-
Standard gray button with gradient
-
-
-
-
-
-
btn btn-primary
-
Provides extra visual weight and identifies the primary action in a set of buttons
-
-
-
-
-
-
btn btn-info
-
Used as an alternative to the default styles
-
-
-
-
-
-
btn btn-success
-
Indicates a successful or positive action
-
-
-
-
-
-
btn btn-warning
-
Indicates caution should be taken with this action
-
-
-
-
-
-
btn btn-danger
-
Indicates a dangerous or potentially negative action
-
-
-
-
-
-
btn btn-inverse
-
Alternate dark gray button, not tied to a semantic action or use
-
-
-
-
-
-
btn btn-link
-
Deemphasize a button by making it look like a link while maintaining button behavior
-
-
-
-
-
Cross browser compatibility
-
-
IE9 doesn't crop background gradients on rounded corners, so we remove it. Related, IE9 jankifies disabled button elements, rendering text gray with a nasty text-shadow that we cannot fix.
-
-
-
Button sizes
-
-
Fancy larger or smaller buttons? Add .btn-lg, .btn-sm, or .btn-xs for additional sizes.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
Buttons
+
+
+
Default buttons
+
+
Button styles can be applied to anything with the .btn class applied. However, typically you'll want to apply
+ these to
+ only <a> and <button> elements for the best rendering.
+
+
+
+
Button
+
class=""
+
Description
+
+
+
+
+
+
+
+
btn
+
Standard gray button with gradient
+
+
+
+
+
+
btn btn-primary
+
Provides extra visual weight and identifies the primary action in a set of buttons
+
+
+
+
+
+
btn btn-info
+
Used as an alternative to the default styles
+
+
+
+
+
+
btn btn-success
+
Indicates a successful or positive action
+
+
+
+
+
+
btn btn-warning
+
Indicates caution should be taken with this action
+
+
+
+
+
+
btn btn-danger
+
Indicates a dangerous or potentially negative action
+
+
+
+
+
+
btn btn-inverse
+
Alternate dark gray button, not tied to a semantic action or use
+
+
+
+
+
+
btn btn-link
+
Deemphasize a button by making it look like a link while maintaining button behavior
+
+
+
+
+
Cross browser compatibility
+
+
IE9 doesn't crop background gradients on rounded corners, so we remove it. Related, IE9 jankifies disabled button
+ elements, rendering text gray with a nasty text-shadow that we cannot fix.
+
+
+
Button sizes
+
+
Fancy larger or smaller buttons? Add .btn-lg, .btn-sm, or .btn-xs for additional sizes.
+
- Heads up!
- We use .disabled as a utility class here, similar to the common .active class, so no prefix is required. Also, this class is only for aesthetic; you must use custom JavaScript to disable links here.
-
-
-
Button element
-
-
Add the disabled attribute to <button> buttons.
-
-
-
-
-
-
+
+ Heads up!
+ We use .disabled as a utility class here, similar to the common .active class, so no prefix is
+ required.
+ Also, this class is only for aesthetic; you must use custom JavaScript to disable links here.
+
As a best practice, try to match the element for your context to ensure matching cross-browser rendering. If you have an input, use an <input type="submit"> for your button.
+
As a best practice, try to match the element for your context to ensure matching cross-browser rendering. If you have an input,
+ use an <input type="submit"> for your button.
-
+
-
-
-
-
Images
-
+
+
+
+
Images
+
-
Add classes to an <img> element to easily style images in any project.
+
Add classes to an <img> element to easily style images in any project.
Icons in sprite form, available in dark gray (default) and white, provided by Font Awesome.
-
-
-
+
Icons in sprite form, available in dark gray (default) and white, provided by
+ Font
+ Awesome.
+
+
+
-
+
-
How to use
+
How to use
-
All icons require an <i> tag with a unique class, prefixed with fa-. To use, place the following code just about anywhere:
-
+
All icons require an <i> tag with a unique class, prefixed with fa-. To use, place the
+ following
+ code just about anywhere:
+
<i class="fa fa-search"></i>
-
There are also styles available for inverted (white) icons, made ready with one extra class. We will specifically enforce this class on hover and active states for nav and dropdown links.
-
+
There are also styles available for inverted (white) icons, made ready with one extra class. We will specifically enforce this
+ class on hover and active states for nav and dropdown links.
+
<i class="fa fa-search fa-white"></i>
-
- Heads up!
- When using beside strings of text, as in buttons or nav links, be sure to leave a space after the <i> tag for proper spacing.
-
+
+ Heads up!
+ When using beside strings of text, as in buttons or nav links, be sure to leave a space after the <i> tag
+ for
+ proper spacing.
+
-
+
-
Icon examples
+
Icon examples
-
Use them in buttons, button groups for a toolbar, navigation, or prepended form inputs.
+
Use them in buttons, button groups for a toolbar, navigation, or prepended form inputs.
Looking at just the dropdown menu, here's the required HTML. You need to wrap the dropdown's trigger and the dropdown menu within .dropdown, or another element that declares position: relative;. Then just create the menu.
+
Looking at just the dropdown menu, here's the required HTML. You need to wrap the dropdown's trigger and the dropdown menu
+ within .dropdown, or another element that declares position: relative;. Then just create the menu.
+
-
+
<div class="dropdown">
<!-- Link or button to toggle dropdown -->
<ul class="dropdown-menu" role="menu" aria-labelledby="dLabel">
@@ -90,122 +91,123 @@
Markup
</div>
-
Options
+
Options
-
Align menus to the right and add include additional levels of dropdowns.
+
Align menus to the right and add include additional levels of dropdowns.
-
Aligning the menus
+
Aligning the menus
-
Add .pull-right to a .dropdown-menu to right align the dropdown menu.
-
+
Add .pull-right to a .dropdown-menu to right align the dropdown menu.
In some cases—like mobile—dropdown menus will extend outside the viewport. You need to resolve the alignment manually or with custom JavaScript.
+
In some cases—like mobile—dropdown menus will extend outside the viewport. You need to resolve the alignment
+ manually or with custom JavaScript.
-
+
-
Split button dropdowns
+
Split button dropdowns
-
Building on the button group styles and markup, we can easily create a split button. Split buttons feature a standard action on the left and a dropdown toggle on the right with contextual links.
+
Building on the button group styles and markup, we can easily create a split button. Split buttons feature a standard action on
+ the left and a dropdown toggle on the right with contextual links.
Dropdown menus can also be toggled from the bottom up by adding a single class to the immediate parent of .dropdown-menu. It will flip the direction of the caret and reposition the menu itself to move from the bottom up instead of top down.
Dropdown menus can also be toggled from the bottom up by adding a single class to the immediate parent of
+ .dropdown-menu. It will flip the direction of the caret and reposition the menu itself to move from
+ the bottom up instead of top down.
add(new BooleanRadioGroup("boolean", new Model<>(Boolean.FALSE)));
-
+
-
Boolean radio buttons with AJAX: the selected value is
+
Boolean radio buttons with AJAX: the selected value is
-
-
-
+
+
+
-
Enum based radio buttons with AJAX: the selected value is
+
Enum based radio buttons with AJAX: the selected value is
-
-
-
+
+
+
-
+
-
-
-
-
Nav: tabs, pills, and lists
-
+
+
+
+
Nav: tabs, pills, and lists
+
-
Lightweight defaults
- Same markup, different classes
-
-
All nav components here—tabs, pills, and lists—share the same base markup and styles through the .nav, .nav-item and .nav-link classes.
-
The base .nav component does not include any .active state. The following examples include the class, mainly to demonstrate that this particular class does not trigger any special styling.
+
Lightweight defaults
+ Same markup, different classes
+
+
All nav components here—tabs, pills, and lists—share the same base markup and styles through the
+ .nav, .nav-item and .nav-link classes.
+
The base .nav component does not include any .active state. The following examples include the class, mainly to demonstrate
+ that this particular class does not trigger any special styling.
For any nav component (tabs, pills, or list), add .disabled for gray links and no hover effects. Links will remain clickable, however, unless you remove the href attribute. Alternatively, you could implement custom JavaScript to prevent those clicks.
+
For any nav component (tabs, pills, or list), add .disabled for gray links and no hover effects.
+ Links will remain clickable, however, unless you remove the href attribute. Alternatively, you could implement
+ custom JavaScript to prevent those clicks.
Change the horizontal alignment of your nav with .justify-content-center and .justify-content-end classes. By default, navs are left-aligned, but you can easily change them to center or right aligned
Change the horizontal alignment of your nav with .justify-content-center and .justify-content-end
+ classes. By default, navs are left-aligned, but you can easily change them to center or right aligned
As tabs and pills are horizontal by default, just add a second class, .flex-column, to make them appear vertically stacked.
-Need to stack them on some viewports but not others? Use the responsive versions (e.g., .flex-sm-column).
-
+
As tabs and pills are horizontal by default, just add a second class, .flex-column, to make them appear vertically
+ stacked.
+ Need to stack them on some viewports but not others? Use the responsive versions (e.g., .flex-sm-column).
+
Bring your tabs to life with a simple plugin to toggle between content via tabs. Bootstrap integrates tabbable tabs in four styles: top (default), right, bottom, and left.
+
Bring your tabs to life with a simple plugin to toggle between content via tabs. Bootstrap integrates tabbable tabs in four
+ styles: top (default), right, bottom, and left.
-
Tabbable example
+
Tabbable example
-
To make tabs tabbable, create a .tab-pane with unique ID for every tab and wrap them in .tab-content.
+
To make tabs tabbable, create a .tab-pane with unique ID for every tab and wrap them in .tab-content.
+
To start, navbars are static (not fixed to the top) and include support for a project name and basic navigation. Place one anywhere within a .container, which sets the width of your site and content.
+
To start, navbars are static (not fixed to the top) and include support for a project name and basic navigation. Place one
+ anywhere within a .container, which sets the width of your site and content.
To properly style and position a form within the navbar, add the appropriate classes as shown below. For a default form, include .navbar-form and either .pull-left or .pull-right to properly align it.
+
To properly style and position a form within the navbar, add the appropriate classes as shown below. For a default form,
+ include .navbar-form and either .pull-left or .pull-right to properly align it.
Align nav links, search form, or text, use the .pull-left or .pull-right utility classes. Both classes will add a CSS float in the specified direction.
+
Align nav links, search form, or text, use the .pull-left or .pull-right utility classes. Both
+ classes will add a CSS float in the specified direction.
Wrap strings of text in an element with .navbar-text, usually on a <p> tag for proper leading and color.
+
Wrap strings of text in an element with .navbar-text, usually on a <p> tag for proper leading
+ and color.
-
+
-
Optional display types
+
Optional display types
-
Fix the navbar to the top or bottom of the viewport with an additional class on the outermost div, .navbar.
+
Fix the navbar to the top or bottom of the viewport with an additional class on the outermost div, .navbar.
-
Fixed to top
+
Fixed to top
-
Add .fixed-top and remember to account for the hidden area underneath it by adding at least 40px padding to the <body>. Be sure to add this after the core Bootstrap CSS and before the optional responsive CSS.
+
Add .fixed-top and remember to account for the hidden area underneath it by adding at least 40px
+ padding to the <body>. Be sure to add this after the core Bootstrap CSS and before the
+ optional responsive CSS.
Create a full-width navbar that scrolls away with the page by adding .navbar-static-top. Unlike the .sticky-top class, you do not need to change any padding on the body.
+
Create a full-width navbar that scrolls away with the page by adding .navbar-static-top. Unlike the .sticky-top
+ class, you do not need to change any padding on the body.
To implement a collapsing responsive navbar, wrap your navbar content in a containing div, .nav-collapse.collapse, and add the navbar toggle button, .navbar-toggle.
To implement a collapsing responsive navbar, wrap your navbar content in a containing div, .nav-collapse.collapse,
+ and add the navbar toggle button, .navbar-toggle.
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.
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.
Badges are our small count and labeling components.
-
+
+
+
+
Badges
+
Badges are our small count and labeling components.
+
-
-
-
-
Example
-
Markup
-
-
-
-
-
- 1
-
-
- <span class="badge">1</span>
-
-
-
-
-
-
Pills
-
-
- 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.
-
-
-
-
-
-
Name
-
Example
-
Markup
-
-
-
-
-
Default
-
- 1
-
-
- <span class="badge">1</span>
-
-
-
-
-
-
-
Badges can be used as part of links or buttons to provide a counter.
+ 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.
+
+
+
+
+
+
Name
+
Example
+
Markup
+
+
+
+
+
Default
+
+ 1
+
+
+ <span class="badge">1</span>
+
+
+
+
+
+
+
Badges can be used as part of links or buttons to provide a counter.
A simple shell for an h1 to appropriately space out and segment sections of content on a page. It can utilize the h1's default small, element as well most other components (with additional styles).
+
A simple shell for an h1 to appropriately space out and segment sections of content on a page. It can utilize the
+ h1's default small, element as well most other components (with additional styles).
With a bit of extra markup, it's possible to add any kind of HTML content like headings, paragraphs, or buttons into thumbnails.
+
With a bit of extra markup, it's possible to add any kind of HTML content like headings, paragraphs, or buttons into
+ thumbnails.
-
-
-
-
+
+
+
+
-
-
Thumbnail label
+
+
Thumbnail label
-
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.
+
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.
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.
+
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.
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.
+
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.
Thumbnails (previously .media-grid up until v1.4) are great for grids of photos or videos, image search results, retail products, portfolios, and much more. They can be links or static content.
+
Thumbnails (previously .media-grid up until v1.4) are great for grids of photos or videos, image search results,
+ retail products, portfolios, and much more. They can be links or static content.
-
Simple, flexible markup
+
Simple, flexible markup
-
Thumbnail markup is simple—a ul with any number of li elements is all that is required. It's also super flexible, allowing for any type of content with just a bit more markup to wrap your contents.
+
Thumbnail markup is simple—a ul with any number of li elements is all that is required. It's
+ also super flexible, allowing for any type of content with just a bit more markup to wrap your contents.
-
Uses grid column sizes
+
Uses grid column sizes
-
Lastly, the thumbnails component uses existing grid system classes—like .col-lg-2 or .col-lg-3—for control of thumbnail dimensions.
+
Lastly, the thumbnails component uses existing grid system classes—like .col-lg-2 or .col-lg-3—for
+ control of thumbnail dimensions.
-
Markup
+
Markup
-
As mentioned previously, the required markup for thumbnails is light and straightforward. Here's a look at the default setup for linked images:
-
+
As mentioned previously, the required markup for thumbnails is light and straightforward. Here's a look at the default setup
+ for linked images:
Alerts
- Styles for success, warning, and error messages
-
-
+
+
+
+
Alerts
+ Styles for success, warning, and error messages
+
+
-
Default alert
+
Default alert
-
Wrap any text and an optional dismiss button in .alert for a basic warning alert message.
+
Wrap any text and an optional dismiss button in .alert for a basic warning alert message.
-
-
-
- Warning! Best check yo self, you're not looking too good.
-
-
-
+
+
+
+ Warning! Best check yo self, you're not looking too good.
+
+
+
<div class="alert alert-warning">
<button type="button" class="btn-close" data-bs-dismiss="alert"></button>
<strong>Warning!</strong> Best check yo self, you're not looking too good.
</div>
-
Dismiss buttons
+
Dismiss buttons
-
Mobile Safari and Mobile Opera browsers, in addition to the data-bs-dismiss="alert" attribute, require an href="#" for the dismissal of alerts when using an <a> tag.
Alternatively, you may use a <button> element with the data attribute, which we have opted to do for our docs. When using <button>, you must include type="button" or your forms may not submit.
Mobile Safari and Mobile Opera browsers, in addition to the data-bs-dismiss="alert" attribute, require an href="#"
+ for the dismissal of alerts when using an <a> tag.
Alternatively, you may use a <button> element with the data attribute, which we have opted to do for our
+ docs. When using <button>, you must include type="button" or your forms may not submit.
Progress bars use CSS3 gradients, transitions, and animations to achieve all their effects. These features are not supported in IE7-9 or older versions of Firefox.
+
Progress bars use CSS3 gradients, transitions, and animations to achieve all their effects. These features are not supported in
+ IE7-9 or older versions of Firefox.
-
Versions earlier than Internet Explorer 10 and Opera 12 do not support animations.
+
Versions earlier than Internet Explorer 10 and Opera 12 do not support animations.
-
+
-
-
-
-
Media object
-
-
Abstract object styles for building various types of components (like blog comments, Tweets, etc) that feature a left- or right-aligned image alongside textual content.
+
+
+
+
Media object
+
+
Abstract object styles for building various types of components (like blog comments, Tweets, etc) that feature a
+ left- or right-aligned image alongside textual content.
-
Default example
+
Default example
-
The default media allow to float a media object (images, video, audio) to the left or right of a content block.
+
The default media allow to float a media object (images, video, audio) to the left or right of a content block.
- Cras sit amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin commodo. Cras purus odio, vestibulum in vulputate at, tempus viverra turpis. Fusce condimentum nunc ac nisi vulputate fringilla. Donec lacinia congue felis in faucibus.
-
- Cras sit amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin commodo. Cras purus odio, vestibulum in vulputate at, tempus viverra turpis. Fusce condimentum nunc ac nisi vulputate fringilla. Donec lacinia congue felis in faucibus.
-
- Cras sit amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin commodo. Cras purus odio, vestibulum in vulputate at, tempus viverra turpis. Fusce condimentum nunc ac nisi vulputate fringilla. Donec lacinia congue felis in faucibus.
-
-
-
-
-
-
+
+
Media heading
+ Cras sit amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin commodo. Cras purus odio,
+ vestibulum in vulputate at, tempus viverra turpis. Fusce condimentum nunc ac nisi vulputate fringilla. Donec lacinia
+ congue felis in faucibus.
+
+ Cras sit amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin commodo. Cras purus odio,
+ vestibulum in vulputate at, tempus viverra turpis. Fusce condimentum nunc ac nisi vulputate fringilla. Donec lacinia
+ congue felis in faucibus.
+
+ Cras sit amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin commodo. Cras purus
+ odio, vestibulum in vulputate at, tempus viverra turpis. Fusce condimentum nunc ac nisi vulputate fringilla.
+ Donec lacinia congue felis in faucibus.
+
Cras sit amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin commodo. Cras purus odio, vestibulum in vulputate at, tempus viverra turpis.
With a bit of extra markup, you can use media inside list (useful for comment threads or articles lists).
-
-
Nested media heading
- Cras sit amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin commodo. Cras purus odio, vestibulum in vulputate at, tempus viverra turpis.
-
-
+
+
+
-
Nested media heading
- Cras sit amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin commodo. Cras purus odio, vestibulum in vulputate at, tempus viverra turpis.
+
Media heading
+
+
Cras sit amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin commodo. Cras purus
+ odio, vestibulum in vulputate at, tempus viverra turpis.
+ Cras sit amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin commodo. Cras
+ purus odio, vestibulum in vulputate at, tempus viverra turpis.
+
+
+ Cras sit amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin
+ commodo. Cras purus odio, vestibulum in vulputate at, tempus viverra turpis.
+
+ Cras sit amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin commodo. Cras
+ purus odio, vestibulum in vulputate at, tempus viverra turpis.
+
- Cras sit amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin commodo. Cras purus odio, vestibulum in vulputate at, tempus viverra turpis.
-
+
+
Media heading
+ Cras sit amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin commodo. Cras purus
+ odio, vestibulum in vulputate at, tempus viverra turpis.
+
- Cras sit amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin commodo. Cras purus odio, vestibulum in vulputate at, tempus viverra turpis.
-
- Contextual text classes also work well on anchors with the provided hover and focus states.
- Note that the .text-white and .text-muted class has no link styling.
-
-
-
-
-
-
-
-
-
-
-
-
-
Background color
-
-
- Similar to the contextual text color classes, easily set the background of an element to any contextual class.
- Anchor components will darken on hover, just like the text classes. Background utilities do not set color, so in some cases
- you’ll want to use .text-* utilities.
-
+ Contextual text classes also work well on anchors with the provided hover and focus states.
+ Note that the .text-white and .text-muted class has no link styling.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Background color
+
+
+ Similar to the contextual text color classes, easily set the background of an element to any contextual class.
+ Anchor components will darken on hover, just like the text classes. Background utilities do not set color, so in some cases
+ you’ll want to use .text-* utilities.
+
+
+
+
+
+
+
+
+
+
+
Java code:
+
+
+
+
+
HTML code:
+
+
+
+
+
Background Color Opacity
+
As of v5.1.0, background-color utilities are generated with Sass using CSS variables. This allows for real-time color
+ changes without compilation and dynamic alpha transparency changes.
+
+
+
+
+
+
+
Java code:
+
+
+
+
HTML code:
+
+
+
+
+
Background Color Gradient
+
+ By adding a .bg-gradient class, a linear gradient is added as background image to the backgrounds. This gradient starts with a semi-transparent white which fades out to the bottom.
+
+
+
+
+
+
+
+
Java code:
+
+
+
+
HTML code:
+
+
+
+
+
+
+
+
Text and Background Color
+
+ Color and background helpers combine the power of our .text-* utilities and .bg-* utilities in one class. Using our Sass color-contrast() function, we automatically determine a contrasting color for a particular background-color.
+