Small Icons
The new bootstrap provides 200 small icons (corresponding to 200 CSS styles), all of which can be applied on inline elements and display the corresponding icons.
1) Basic usage: Apply the corresponding style to any inline element.
All of the icon styles start with glyphicon-, because these small icons are http:/glyphicons.com/Web site, when used must use two styles at the same time, that is. Glyphicon and begins with. glyphicon-* Style.
2) Implementation: The new icon uses the @font-face feature and combines certain fonts to create icon icons in the Web page.
Syntax: @font-face{
Font-family: <YourWebFontName>;
SRC: <source> [< format;] [,<source> [< format >]]*;
[Font-weight: < weight >];
[Font-style: < Style >];
}
3) Application scenario: The icon style can be used in various element containers, such as button elements, nav list elements, and so on.
Drop-down menu
Bootstrap provides a common menu display by default, and menu presentation in various interactive states needs to be used in conjunction with JavaScript's dropdown plugin.
1) Basic usage: Apply the. Open style to the parent element of the menu, and the element is set to position:relative (or directly using the. Dropdown style), the. Dropdown style is a large container,. dropdown- menu is the container for the LI element of the menus, and the. Divider style appears on the LI element as a delimiter. The drop-down menu will not display properly. In addition to delimiters, the 3.x version also provides a menu caption function (similar to a grouped caption), using the. Dropdown-header style,
Since the menu is left-aligned by default, Bootstrap also provides an additional. Pull-right style that allows the menu to be right-aligned relative to the parent container (note. Pull-right to be applied with. Dropdown-menu).
2) Multilevel nesting
The old version uses nesting in the. Dropdown-meun style to achieve similar functionality by simply applying the. Dropdown-submenu style to the submenu item, and then in the Li element, as with the standard menu settings, a new UL element is nested inside ( In this UL also need to set the standard. Dropdown-menu style).
Button Group
1) Basic usage: Just use a container element (such as a div) outside of multiple buttons, then apply the. Btn-group style to the container element. The buttons in the container can use the button element or the a element to produce the same effect. The way the system is presented and arranged is mainly controlled by the. Btn-group style and the. BTN style.
By default, the 4 corners of a set of buttons should be rounded (supported CSS3).
2) button toolbar: Place a large container element outside of multiple groupings, and then apply another new. Btn-toolbar style to the container element.
3) button Size setting: You can use the 3 additional dimensions of the. BTN style, which is. BTN-LG,. Btn-sm,. Btn-xs to adjust the button size,
However, Bootstrap also provides extra styling for button groups so that you don't have to reapply styles on multiple buttons. The usage is: Apply the. Btn-group-lg,. Btn-group-sm,. Btn-group-xs styles again on elements of the. Btn-group style to provide the same effect, once set, and all groups are valid.
4) Nested grouping: Simply wrap the dropdown drop-down menu outside a div container element and reapply it on the DIV element. Btn-group style, and the normal 1, 2, 3 buttons at the same level.
5) Vertical grouping: You only need to replace the. Btn-group style in the base usage with the. btn-group-vertical style.
6) Adaptive Grouping: the. Btn-group-justified style provides a special feature, that is, on a. Btn-group container, if the style is used, all buttons will be 100% filled with the container element, that is, the width of the container element is high, the width of the button will become how much ,
Button drop-down menu
The effect of the. BTN style is encapsulated on the basis of the normal drop-down menu, which is similar to clicking a button and then displaying the hidden drop-down menu.
1) Combo drop-down menu: It is the normal drop-down menu, except that the trigger element is changed from the a element to the button element (it can also be applied on a element. BTN style implementation). The only difference is that the style of the outer container has changed from. Dropdown to. Btn-group.
2) Split drop-down menu: Click events to trigger execution by setting data-toggle= "dropdown" and data-target= "", so you can make the arrows stand alone as a button, while the original button remains, so that two buttons are emitted together,
3) button Size: Either the combo drop-down menu or the detached drop-down menu can be used. BTN the original attached style. Btn-lg,. Btn-sm,. Btn-xs to control the size of the button.
4) Bounce-up drop-down menu: When used in comparison with the normal drop-down menu, just attach one more. Dropup style.
Input Box Group
1) Basic usage: simply apply the. Input-group style to the container and apply the. Input-group-addon style to the personality elements that need to be displayed before and after input.
Try to avoid using this feature on the SELECT element because the WebKit browser does not fully support the features of the Input-group component.
Do not mix the. Input-group and. Form-group directly, because. Input-group is a standalone component.
2) Size setting: Bootstrap on the. Input-group-addon style container, you can also apply similar styles to achieve the purpose of setting dimensions, and provide large and small styles (. Input-group-lg and. Input-group-sm), No ultra-small style is provided.
3) check boxes and radio boxes as addon: simply place input with the checkbox and radio type within the. Input-group-addon style.
4) button as Addon: the author for the. BTN style is also individually set up with a. INPUT-GROUP-BTN style (mentioned in the underlying usage), replacing it with the. Input-group-addon as the new addon container.
5) Drop-down menu button as addon: Just apply a data-toggle= "dropdown" property on the normal. BTN button.
6) The Segment button as addon: All buttons must be placed inside the. input-group-btn style container.
Navigation
Navigation (NAV) is one of the most important parts of a website, which makes it easy for users to find the various functional services provided by the website. The default. NAV style does not provide a default navigation and must be done by attaching another style, such as the. Nav-tabs style, which represents the tab navigation.
1) tab Navigation: The main principle is to make each Li item appear as block-level elements, then define the style and mouse trigger behavior of non-highlighted menus, and finally define the style and mouse behavior of the highlighted menu item. If you need to work with the Click menu to display the content area of the corresponding tab immediately, you need to match the tab component in the JS component.
2) Capsule tab navigation: replace the. Nav-tabs style with the. Nav-pills style to transform it into a completely different effect.
3) Stacked navigation: the so-called stacked navigation, is the normal navigation menu stacked vertically. Only one additional. nav-stacked style is required on the basis of nav-pills.
4) Adaptive Navigation: For adaptive navigation, as with the. btn-group-justified style of the button group, you can fill the LI element with the entire parent container, with a style of. Nav-justified. You only need to attach it to the. nav-tabs or. Nav-pills style when you use it.
5) Disable link: An LI element in the navigation menu item needs to be disabled, you can apply the disabled style to the button element. This style simply disables the appearance of the effect, and does not really prevent subsequent clicks, so you also need to use JavaScript code to special handle the Click event (Block bubbling, E.preventdefault (), E.stoppropagation (), Return to False code).
Whether it's a. nav-tabs or. Nav-pills-style navigation, you can control the entire navigation to the left or right by appending a. Pull-left or. Pull-right style.
Navigation bar
1) basic navigation bar: first in the general navigation of the UL element on the application. Navbar-nav style, and then apply the NavBar style and the. Navbar-default style to the external parent element container.
The main function of the NavBar style is to set the left and right padding, rounded corners, etc., but not the color-related content, because the color-related content is controlled by the. Navbar-default style.
2) Form in the navigation bar: Place the form element inside the. NavBar container and apply the. Navbar-form style to the form element. Both left and right floating styles (. Navbar-left and. Navbar-right) can also be used in order to control the left-to-all alignment. For forms within the navigation bar, you can hide the label label by using the. Sr-only style.
3) buttons, text, links in the Navigation bar: button (navbar-btn), text (navbar-text), normal link (navbar-link)
。 If you apply a button, text, or normal link individually, you will only support one or up to two (you need to set left and right floats) and need to work with the A element of UL or Navbar-brand style.
4) The items in the navigation bar float left and right: set the. Navbar-left style or Navbar-right style on the various menu item containers in the navigation bar, such as UL, p, and so on, to let the container element float around. These styles are the mixin versions of. Pull-left and. Pull-right, but they are limited to media queries, which makes it easier to work with navigation bar components on screens of various sizes.
5) Top fixed or bottom fixed:. Navbar-fixed-top supports top-mounted,. Navbar-fixed-bottom supports the most bottom pinning. At the top, the top of the page is obscured (or, at the bottom, the bottom of the page is obscured). To solve this problem, you need to set the padding value on the body. Since the default navbar height is 50px, the general padding value is set to 70px.
The. Navbar-static-top style, which is used to represent a 100% navigation bar that is filled with the parent element container. In fact, the use of NavBar style by default is also 100% full width, the only function of the. Navbar-static-top style is to remove the fillet setting of the navigation bar.
6) Responsive navigation bar: the button icon (icon) must be included in the. Navbar-toggle style and, depending on the requirements of the responsive navigation, the icon icon should not be displayed when the browser is larger than 768 pixels.
7) Anti-color navigation bar: Anti-color navigation source code and. Navbar-default almost the same, not the same as just a variety of color settings, if you want to expand their style, be sure to follow the same code as the. Navbar-inverse color change.
Breadcrumbs Navigation
Breadcrumbs (BREADCRUMB) are generally used for navigation, indicating where the current page is located (or a feature plug-in).
Paging navigation
Bootstrap provides you with two paging components, a component with multiple page numbers (pagination), and a page-turn component (pager) that has only the previous page and the next.
1) page pagination: Just set the pagination style on the UL and set the page Number link on the LI element.
For pagination, the current page is generally highlighted and no click is allowed. On the first page, the previous link is not allowed to click. For this bootstrap, there are two common styles to implement, namely: active and disabled. In general, the final scenario is to use the span element instead of the a element in the LI element of the two styles described above.
Pagination also supports increasing and narrowing styles, which are:. PAGINATION-LG and. Pagination-sm.
2) page turn: By default, this component provided by Bootstrap is centered.
If you need to connect the two buttons to align left and right, you will need to apply the previous and next styles separately on the LI element of the button, respectively, on the LI elements. Pull-left and. Pull-right styles can also achieve the above effects, and, in addition, common links ( or other button element), the disabled style is applied to disable the effect, the disabled style simply implements the disable effect and does not disable the click function of a link. So if you want to disable the click feature, either use JavaScript to disable A's click behavior, or simply use the span element, because the paging component supports both A and span two elements.
Label
Bootstrap provides a. label style that is used to implement highlighting functionality. Just apply the label style to the highlighted place.
If the label works on a linked element, the background color of hover and focus is slightly darker by 10%.
The label style also provides support for a variety of colors, namely success green, warning yellow, dangerous red, information blue,
For the label style on the href link of the scope, the background color of hover and focus also deepens by 10%.
You can extend the size of a label like. BTN, such as LABEL-LG, LABEL-SM, and similar styles.
Badge
When developing interactive systems or information systems, it is often necessary to display the latest messages received, the number of approvals required, and so on. The bootstrap. Badge style provides a good effect, just apply the style on a span or label.
If there is no content inside the. Badge style app (for example: There are no new messages), the. Badge style disappears automatically.
Badge styles can also have similar styles on button element buttons or List-group-item and nav-pills, except that the colors are slightly different.
Big Screen Broadcasting
When designing a Web page layout, there are often large screens (or bulky) content displayed, and the. Jumbotron style provides the impression that we need,
Page title
The. Page-header style in Bootstrap provides a similar display of H1 elements, except that the margin and bottom padding are slightly larger, with a slightly larger 1-pixel border at the bottom.
Thumbnail images
Combining the 12 grid system and using the. Thumbnail style, you can display images, videos, and text more beautifully.
If you want the label to extend the same as badge, modify the border:1px solid #dddddd; thumbnail.
Thumbnails are used in two ways, one for displaying pictures only, and the other for displaying pictures and titles together using a container. You can add any style elements, such as buttons, links, and so on, within the. Caption style element container.
Warning Box
In interactive Web pages, it is often important to provide users with flexible prompt messages based on the context of the user's actions, such as successful operations, warning prompts, error messages, and so on. The alert style provides the underlying action style for this purpose.
1) Default warning box: Include with alert style div element container (P element also can), optionally add a close button element inside, but close button to ensure that the property value of the button element is set data-dismiss= "alert", The reason is that the close function of the warning box is detected by JavaScript for this property.
2) The warning box can be closed: on the. Alert style, apply a. alert-dismissable style to implement a closed warning box.
3) Colorful style warning box: On the basis of the default light yellow, there are also 3 styles available: Alert-danger (dangerous Red), alert-success (Success Green), Alert-info (information blue).
4) The link in the warning box: Bootstrap in 4 different colors of the style to provide the link color highlighting, the same way the application, in the alert container element of a link to apply the. Alert-link style to achieve the desired effect.
Progress bar
1) Basic style: basic progress bar in use only need to apply two styles: progress and Progress-bar. The progress is used to set the container style for the progress bar, while Progress-bar is used to limit progress (color progress) of the progress bar.
2) Colorful style: 4 colors are added by default: Progress-bar-info (Information Blue), progress-bar-success (Success Green), progress-bar-warning (warning yellow), Progress-bar-danger (Dangerous red).
3) Stripe style: Only a new progress-striped style is appended to the container element, and the implementation of this style is implemented using the CSS3 linear gradient feature linear-gradient.
4) Animation style: Let the stripes move, just attach a more active style to the progress bar container element. The active style must be applied together with the. progress-striped style. and IE browser only IE10 above to support the animation transition effect.
5) Stacking style: Progress-bar.
Media Objects
To build different types of components that have left-aligned or right-aligned images within text (like blog content or tweets, etc.), the default style is to float a media object (picture, video, audio) to the left or right of the content area.
1) Default style: The default usage of a set of media typically includes the following styles: Media, Media-object, Media-body, media-heading 4 styles, and a pull-left for controlling left and right floats (or pull-right Style
2) Media list: If you need to display a list of multiple media, you can use the Media-list style on the UL, apply media style on the Li to achieve.
List groups
1) Base list group: Most of the list groups are implemented by untagged lists (UL/LI) and then implemented by applying specific styles. List groups have 2 basic styles: List-group and List-group-item. These two styles primarily set up basic display and layout content, such as spacing, upper and lower rounded corners, and so on.
2) Apply badge tag or navigation arrows: Place the span element (or other restrained element label, i) inside the LI element that marks the small icon.
3) linked list group: use ordinary div element instead of UL element, use a LINK element instead of Li element, and apply List-group-item style on element A to achieve the desired effect. Adding an additional style of active will cause the list item to be highlighted.
4) Colorful list items: This component provides a style similar to list-group-item-succes for specifying the background color, and also supports highlighting style active.
5) Custom list items: On the basis of a list group that can be linked, Bootstrap provides both list-group-item-heading and List-group-item-text styles, and two styles are mainly text that controls the normal and highlighted states ( Heading) color and content (text) color.
Panel
1) Base Panel: Apply panel on Div to produce a text box with a border. Pannel style does not control the theme color, Pannel-default is the theme of color control, but also a pannel-body style, specifically for storing text content,
2) with head and tail Panel: Panel Head (panel-heading) and panel tail (panel-footer) style, its function is to highlight the corresponding panel head and the end of the panel.
3) Colorful panel: Available in 5 colors: panel-primary (key Blue), panel-success (Success Green), panel-warning (warning yellow), Panel-danger (Dangerous Red), Panel-info (information blue). Just attach a color style to the style of the existing panel.
4) Nesting of panels and tables
5) Panels and list groups are nested: As with the table, when the list group is used in the panel, the bootstrap author also makes fine tuning, mainly to adjust the border overlap problem, that is, if two components have a bottom border, then cancel one.
Depression
The effect of the Depression (well) style is similar to the large screen Jumbotron style, where the well style has border settings and the default height is the height of the adaptive text.
The well style also provides styles of different sizes (mainly panding and fillet sizes), respectively: Well-lg and WELL-SM. When used, it can be applied directly to the same element as well. You can also transform well to support the display of different colors (such as the change of border and background color), like Well-success, Well-info, and so on.
Theme
A new Bootstrap-theme.css file has also been added to the bootstrap version of--3.x, which does not provide any additional functionality and is only enhanced for some common CSS components.
1) btn button style theme: In theme, BTN-related styles enhance (or change) the button shadows and background colors.
2) Thumbnail style theme: Enhanced Shadow settings.
3) drop-down menu style theme: Two similar enhancements to the a link in Li.
4) navigation bar style theme: Since the navigation bar has two kinds of--navbar-default and Navbar-inverse, the two styles are modified respectively when enhanced.
5) Warning Box style theme: Uniformly adjusts shadow settings and adjusts the border color and background settings for all styles.
6) progress bar style theme: The adjustment of the progress bar is related to the background, form and alert box alert similar,
7) List Group style theme: First, adjust the fillet and shadow settings of the list group container, followed by the shading, background, and border color of the currently highlighted list item.
8) Panel Style theme: One is the shadow of the container, one is the background adjustment of the head element under each style.
9) The Well style theme: The adjustment of the Fit is also the background, border color.
Theme files do not have to be referenced, and if you prefer this style, you can refer to your own theme name, such as BOOTSTRAO-THEME-FLATUI.CSS, if you want to customize your own style. However, it is important to note that the file must be referenced after the Bootstarp.min.css file, otherwise it overrides the default effect.
The above full text reference from "in-depth understanding bootstrap"
"Learning Notes" bootstrap CSS components