Home > Web Front-end > JS Tutorial > Chapter Six: Auxiliary Group Classes and Responsive Tools_javascript skills

Chapter Six: Auxiliary Group Classes and Responsive Tools_javascript skills

WBOY
Release: 2016-05-16 15:04:07
Original
1474 people have browsed it

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. Auxiliary group class

2. Responsive tools

In this lesson, we mainly learn about Bootstrap’s auxiliary classes and responsive tools. The auxiliary classes provide a set of classes to assist in page design, while the responsive tools use media queries to display or hide certain content.

1. Auxiliary class

Bootstrap provides some small auxiliary group styles in layout, used for setting text color and background color, displaying close icons, etc.

1. Scenario text color

样式列表
样式名 描述
text-muted 柔和灰
text-primary 主要蓝
text-success 成功绿
text-info 信息蓝
text-warning 警告黄
text-danger 危险红 
//各种色调的字体
<p class="text-muted">Bootstrap 视频教程</p>
<p class="text-primary">Bootstrap 视频教程</p>
<p class="text-success">Bootstrap 视频教程</p>
<p class="text-info">Bootstrap 视频教程</p>
<p class="text-warning">Bootstrap 视频教程</p>
<p class="text-danger">Bootstrap 视频教程</p> 
Copy after login

2. Scene background color

样式列表

样式名 描述
bg-primary 主要蓝
bg-success 成功绿
bg-info 信息蓝
bg-warning 警告黄
bg-danger 危险红 
//各种色调的背景
<p class="bg-primary">Bootstrap 视频教程</p>
<p class="bg-success">Bootstrap 视频教程</p>
<p class="bg-info">Bootstrap 视频教程</p>
<p class="bg-warning">Bootstrap 视频教程</p>
<p class="bg-danger">Bootstrap 视频教程</p> 
Copy after login

3.Close button

<button type="button" class="close">&times;</button> 
Copy after login

4. Triangle symbol

<span class="caret"></span> 
Copy after login

5. Quick float

<div class="pull-left">左边</div>
<div class="pull-right">右边</div> 
Copy after login

Note: This float is actually float, but !important is used to strengthen the priority.

6. Block-level centering

<div class="center-block">居中</div> 
Copy after login

Note: is margin:x auto; and display:block; is set.

7. Clean up floats

<div class="clearfix"></div> 
Copy after login

Note: This div can be placed in front of the floating block that needs to be cleaned.

8. Show and hide

<div class="show">show</div>
<div class="hidden">hidden</div> 
Copy after login

2. Responsive Tools

When media querying, sometimes it is necessary to show and hide some content for different screen sizes. Responsive tool classes provide this solution.

//超小屏幕激活显示
<div class="visible-xs-block a">Bootstrap</div> 
//超小屏幕激活隐藏
<div class="hidden-xs a">Bootstrap</div> 
Copy after login

Note: There are three variations for the displayed content: block, inline-block, and inline.

The above is the content related to the auxiliary group classes and responsive tools of the BootStrap component introduced by the editor. I hope it will be helpful to everyone!

Related labels:
source:php.cn
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template