Home > php教程 > PHP开发 > Summary of Bootstrap's class styles

Summary of Bootstrap's class styles

高洛峰
Release: 2016-12-03 10:42:59
Original
1202 people have browsed it

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

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>
Copy after login

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>
Copy after login

Add the following style code in the file:

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

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

Related labels:
Statement of this Website
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
Latest Issues
There is no bootstrap custom video tutorial
From 1970-01-01 08:00:00
0
0
0
Laravel: Problem using bootstrap locally
From 1970-01-01 08:00:00
0
0
0
html5 - Problem with bootstrap modifying style
From 1970-01-01 08:00:00
0
0
0
Introducing bootstrap is invalid
From 1970-01-01 08:00:00
0
0
0
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template