Bootstrap, from Twitter, is currently the most popular front-end framework. Bootstrap is based on HTML, CSS, and JAVASCRIPT. It is simple and flexible, making web development faster.
Learning points:
1. Form
2. Button
In this lesson, we will mainly learn about Bootstrap table and button functions, and display various rich effects through built-in CSS definitions.
1. Form
Bootstrap provides some rich table styles for developers to use.
1. Basic format
//实现基本的表格样式 <table class="table">
Note: We can view the corresponding CSS through Firebug.
2. Striped table
//让<tbody>里的行产生一行隔一行加单色背景效果 <table class="table table-striped">
Note: The table effect needs to be based on the basic format.table
3. Table with borders
//给表格增加边框 <table class="table table-bordered">
4. Hover the mouse
//让<tbody>下的表格悬停鼠标实现背景效果 <table class="table table-hover">
5. Status class
//可以单独设置每一行的背景样式 <tr class="success">
Note: A total of five different styles are available.
Style description:
Active mouseover on row or cell
Success identifies success or positive action
info identifies common prompt information or actions
The warning sign warns or requires user attention
Danger means dangerous or potentially negative actions
6. Hide a certain row
//隐藏行 <tr class="sr-only">
7. Responsive form
//表格父元素设置响应式,小于 768px 出现边框 <body class="table-responsive">
2. Button
Bootstrap provides many rich buttons for developers to use.
1. Labels or elements that can be used as buttons
//转化成普通按钮 <a href="###" class="btn btn-default">Link</a> <button class="btn btn-default">Button</button> <input type="button" class="btn btn-default" value="input">
There are three things to note:
(1). Precautions for components
Although button classes can be applied to and
(2). Things to note when links are used as buttons
(3). Cross-browser display
The best practices we summarized are: It is strongly recommended to use the
In addition, we also discovered a bug in Firefox <30 version of the browser, which prevents us from setting the line-height attribute for buttons created based on the element, which results in The Firefox browser cannot maintain the same height as other buttons.
2. Predefined styles
//一般信息 <button class="btn btn-info">Button</button>
Style Description
btn-default default style
btn-success success style
btn-info general information style
btn-warning warning style
btn-danger dangerous style
btn-primary preference style
btn-link link style
3. Size
//从大到小的尺寸 <button class="btn btn-lg">Button</button> <button class="btn">Button</button> <button class="btn btn-sm">Button</button> <button class="btn btn-xs">Button</button>
4. Block-level buttons
//块级换行 <button class="btn btn-block">Button</button> <button class="btn btn-block">Button</button>
5.Activation status
//激活按钮 <button class="btn active">Button</button>
6. Disabled status
//禁用按钮 <button class="btn active disabled">Button</button>
The above is the Bootstrap table and button functions introduced by the editor. I hope it will be helpful to you!