Bootstrap common class name
Bootstrap
Assign a class name to a label(class name)
To generate the effect tag of the corresponding class name.
Grid options
row
: Line
col-*-*
: Column (First*
Can beXs [Ultra small]
/Sm [small]
/Md [medium]
/Lg [large]
Second*
Must be less than 12 [columns])
col-*-offset-*
: Column offset (First*
Same as above,Second*
The range is from 1 to 11, indicating that the left margin (margin) of the column is increased.*
Column)
col-*-*-*
: Column sorting (First*
Same as above,Second*
Can bePush [to the right]
/Pull [left]
, Third*
Range: 1 to 11 [columns])
Typographical
small
: Inline subtitle
lead
: Boot body copy
text-*
: Text style (*
The ID can be
Left [left alignment]
/Center [center alignment]
/Right [right alignment]
/Muted [deprecated text]
/primary
/success
/info
/warning
/danger
/Justify [automatic line feed]
/Nowrap [do not wrap]
/Lowercase [lower case]
/Uppercase [uppercase]
/Capitalize [uppercase letters])
list-inline
: The list is placed in the same row
Table
table
: Basic style (only horizontal separator)
table-*
: Table style (*
Can beStriped [add stripe]
/Bordered [Add a border]
/Hover [enable hover]
/Condensed [more compact]
)
tr/th/td
Yesactive/success/info/warning/danger
To change the background color.
Set anytable
Put intable-responsive
To implement a responsive table
bootstrap
Liactive/success/info/warning/danger
Corresponding background color
Form
To create a basic form (vertical form)
1. directed to the parent<form>
Add Elementrole="form"
.
2. Place tags and controls inclass .form-group
Of<div>
. This is required to obtain the optimal spacing.
3. To all text elements<input>
,<textarea>
And<select>
Addclass .form-control
.
Create a horizontal form
1. directed to the parent<form>
Add Elementclass .form-horizontal
.
2. Place tags and controls inclass .form-group
Of<div>
.
3. Add tagsclass .control-label
.
Common form controls are mainly input
,textarea
,checkbox
,radio
Andselect
.
input
: Declarationtype
Yestext
,password
,datetime
,datetime-local
,date
,month
,time
,week
,
number
,email
,url
,search
,tel
Andcolor
.
textarea
:row
Height
checkbox
: Check box
radio
: Single region
checkbox-inline
: Inline check box and single-line
select
: Select box
Add verification status to parent Elementhas-*
: Verify the style (*
Can bewarning/error/success
)
Button
btn
: Basic style
btn-*
: Other styles (*
Can bedefault/primary/success/info/warning/danger
/Link [make the button look like a link]
/lg/sm/xs/
Block [block-level button, stretched to 100% of the width of the parent element]/active/disabled
)
Image
img-*
: Image style (*
Can beRounded [rounded corner 6px]
/Circle [circle]
/Thumbnail [Add the padding and a gray border]/responsive
)
Auxiliary class
Bootstrap
In addition toactive/success/info/warning/danger
And
pull-left/right
Element float to left/right
center-block
Set the elementdisplay:block
Center display
clearfix
Clear floating
show/hidden
Force display/hide
close
Show close button
caret
Show drop-down Function
divider
Separation line
Font icon
Infonts
You can find the font icon in the folder, which contains the following files:
glyphicons-halflings-regular.eotglyphicons-halflings-regular.svgglyphicons-halflings-regular.ttfglyphicons-halflings-regular.woff
More icon reference http://www.runoob.com/bootstrap/bootstrap-glyphicons.html
Drop-down menu
dropdown
: Drop-down menu
dropdown-menu
: Drop-down menu
dropdown-header
: Drop-down menu area title
Button Group
btn-group
: Contains a seriesbtn
btn-toolbar
: Contains several groupsbtn-group
btn-group-*
: Adjust the style of the button group (*
Can bexs/sm/lg/vertical
)
.btn-group
Add container.dropup
Click to pull the menu
Input box Group
Direction.form-control
To add a prefix or suffix, follow these steps:
1. Place the prefix or suffix element inclass .input-group
Of<div>
.
2. Then, in the same<div>
Inclass
Is.input-group-addon
Of<span>
Add additional content.
3. Set<span>
Placed in<input>
The front or back of an element.
Bytes
To maintain cross-browser compatibility, avoid using<select>
Element, because they areWebKit
The effect cannot be completely rendered in the browser. Do not applyclass
The input box group is an isolated component.
Navigation Element
nav nav-tabs
: Label-based navigation menu
nav nav-pills
: Capsule navigation menu
// Use bothnav-stacked
Stack capsules vertically
// Use bothnav-justified
Make the label or capsule navigation menu equal to the parent element width
Navigation Bar
To create a default navigation bar, follow these steps:
1. Forward<nav>
Add tagsclass .navbar
,.navbar-default
.
2. Add the above Elementrole="navigation"
To help increase accessibility.
3. Forward<div>
Add a title to the elementclass .navbar-header
, Containsclass navbar-brand
Of<a>
Element. This will make the text look bigger.
To add a link to the navigation bar, simply addclass .nav
,.navbar-nav
.
navbar-btn
: Buttons in the navigation bar
navbar-text
: Text in the navigation bar
navbar-link
: Non-standard navigation link
navbar-left/right
: Align left/right
navbar-fixed-top/bottom
: Fixed at the top/bottom (to prevent the navigation bar from being staggered with the top of other content in the page body, please<body>
Add at least 50 pixels of padding (padding
), The padding value can be set according to your needs)
navbar-static-top
: Navigation bar that can be rolled along with the page
nav-inverse
: Navigation bar with black background and white text
Bread navigation
breadcrumb
Paging
'Pagination': pagination 'Disabled/active': Click not allowed/'pager': page turning 'previous/next': Align the link to the left/to the right
Tag
label-*
: Tag (*
Can bedefault/primary/success/info/warning/danger
)
Badge
badge
Large Screen
jumbotron
Page title
page-header
Thumbnail
thumbnail
Add custom content
Now we have a basic thumbnail. We can add various HTML content to the thumbnail, such as the title, paragraph, or button. The procedure is as follows:
1. Putclass .thumbnail
Of<a>
Label changed<div>
.
2. In<div>
You can add anything you want to add. Because this is<div>
, We can use the defaultspan
To adjust the size.
3. If you want to group multiple images, place them in an unordered list, and each list item changes to the left.
Warning
alert alert-*
: Warning box (*
Can besuccess/info/warning/danger
)
Create a cancelling warning (Dismissal Alert
) Steps are as follows:
1. Create<div>
And add.alert class
And four contextsclass
(That is.alert-success、.alert-info、.alert-warning、.alert-danger
) To add a basic warning box.
2. At the same time<div>
class
Add optional.alert-dismissable
.
3. Add a close button.
Progress bar
To create a basic progress bar, follow these steps:
1. Addclass .progress
Of<div>
.
// Add both.progress-striped
To implement the stripe style progress bar
// Then addactive
It will make the striped movement from right to left
2. Then<div>
, Addclass .progress-bar
Of<div>
.
// Add bothclass progress-bar-*
To achieve the progress bar of the alternate style, where,*
Yessuccess、info、warning、danger
.
3. Add a width with a percentagestyle
Properties, suchstyle="60%"
; Indicates that the progress bar is in60%
.
Multimedia object
media
: Allows multimedia (images, videos, and audios) in a media object to the left or right of the content block.
.media-list
: If you need a list, the content of each item is part of the unordered list, you can use thisclass
. Can be used for comment list and article list
List Group
To create a basic list group, follow these steps:
Direction Element<ul>
Addclass .list-group
.
Direction<li>
Addclass .list-group-item
.
list-group-item-heading
: Eachitem
Is similarText of cell in ios
list-group-item-text
: Eachitem
Is similarCell subtitle text in ios
Panel
panel panel-default
: Panel
panel-heading
: Panel header
panel-title
: Panel title
panel-body
: Panel content
panel-footer
: Panel footer