Home  >  Article  >  php教程  >  Summary of Bootstrap’s class styles

Summary of Bootstrap’s class styles

高洛峰
高洛峰Original
2016-12-03 10:42:591086browse

Basic class

.code to display a single line of inline code
.pre to display multi-line block code
.kbd to display user input code
.pre-scrollable If the height exceeds 340px, a scroll bar will appear on the Y-axis

Table class

.table basic table margin-bottom: 20px, 2px solid light gray line at the bottom of thead, 1px solid light gray line at the top of each cell
.table-striped: Zebra table, every other row has a light gray background Color
.table-bordered: A table with borders, all cells have a 1px border
.table-hover: Hover the mouse over the rows of the table, with a highlighted background color
.table-condensed: Convert the cells Adjust the padding from 8px to 5px
.table-responsive: Set the container with the class name .table-responsive, and place 3f3b640447c436714e8261f737c17eb1 in this container

The class of the table row

.active indicates Current activity information
.success success or correct behavior
.info represents neutral information or behavior
.warning represents warning
.danger represents danger or wrong behavior

In addition to .active, the other four class names should be coordinated with .table-hover

Form

.form-horizontal horizontal form effect, matching the grid system of the Bootstrap framework; setting the form control padding and margin values; changing the expression of "form-group", similar to the "row" of the grid system
When using input in Bootstrap, you must also add the type type. In order to make the control style correct in various form styles, you need to add .form-control. Multi-row selection sets the value of the multiple attribute to multiple. Rows defines the height, and cols sets the width. .form-control, there is no need for cols
Both checkbox and radio use the label package
If the checkbox needs to be arranged horizontally, you only need to add the class name "checkbox-inline" to the label label

Fixed navigation bar

The top and bottom of the main content of the page All are covered by the fixed navigation bar. In order to prevent the fixed navigation bar from covering the content, we need to do some processing on the body:

body {
padding-top: 70px;/*有顶部固定导航条时设置*/
padding-bottom: 70px;/*有底部固定导航条时设置*/
}
<div class="navbar navbar-default navbar-fixed-top" role="navigation">
 …
</div>

In fact, in addition to this solution, we have other solutions, placing the fixed navigation bar on the page content Front:

<div class="navbar navbar-default navbar-fixed-bottom" role="navigation">
 …
</div>
<div class="content">我是内容</div>

Add the following style code in the file:

.navbar-fixed-top ~ .content {
padding-top: 70px;
}
.navbar-fixed-bottom ~ .content {
padding-bottom: 70px;
}

The above is a summary of Bootstrap class styles introduced by the editor. I hope it will be helpful to everyone

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn