Bootstrap--CSS--auxiliary class

Source: Internet
Author: User

Text text color

If the text is a link, the text is dimmed when you move the mouse over the linked text

. text-muted: Grey

. Text-primary: Light Blue

. Text-success: Green

. Text-info: Dark blue

. text-warning: Orange

. Text-danger: Red

Text position

. Text-left: Text left Justified

. Text-center: Text Center alignment

. text-right: Text right-aligned

Wrap text

. text-justify: Text alignment, out of screen part text wrapping

. TEXT-NOWRAP: Paragraph beyond the screen part does not wrap

Text case

. text-lowercase: Text lowercase

. Text-uppercase: Text capitalization

. Text-capitalize: Capitalize the first letter of the word

Background

Background color, if the text is a link, the background dims when you move the mouse over the text

Other

Fast Floating

You can use class Pull-left or pull-right to float elements to the left or right, respectively. This is demonstrated in the following example.

<!DOCTYPE HTML><HTML><Head>   <title>Bootstrap instances-Fast floating</title>   <Linkrel= "stylesheet"href= "Http://apps.bdimg.com/libs/bootstrap/3.3.0/css/bootstrap.min.css">   <Scriptsrc= "Http://apps.bdimg.com/libs/jquery/2.1.1/jquery.min.js"></Script>   <Scriptsrc= "Http://apps.bdimg.com/libs/bootstrap/3.3.0/js/bootstrap.min.js"></Script></Head><Body><Divclass= "pull-left">Quick Float to left</Div><Divclass= "pull-right">
Quick Float to right
</ Div > </ Body > </ HTML >

The results are as follows:

To align the components in the navigation bar, use. navbar-left or. Navbar-right instead. Please check the Bootstrap navigation bar.

Clear floating

To clear the float of an element, use the. Clearfix class.

<!DOCTYPE HTML><HTML><Head>   <title>Bootstrap instance-Clear float</title>   <Linkrel= "stylesheet"href= "Http://apps.bdimg.com/libs/bootstrap/3.3.0/css/bootstrap.min.css">   <Scriptsrc= "Http://apps.bdimg.com/libs/jquery/2.1.1/jquery.min.js"></Script>   <Scriptsrc= "Http://apps.bdimg.com/libs/bootstrap/3.3.0/js/bootstrap.min.js"></Script></Head><Body><Divclass= "clearfix"style= "background: #D8D8D8; border:1px solid #000;p adding:10px;">   <Divclass= "pull-left"style= "background: #58D3F7;">Fast floating to the left</Div>   <Divclass= "pull-right"style= "background: #DA81F5;">Fast floating to the right</Div></Div></Body></HTML>

The results are as follows:

Content Centered

Use class Center-block to center the element.

<!DOCTYPE HTML><HTML><Head>   <title>Bootstrap Instance-center content block</title>   <Linkrel= "stylesheet"href= "Http://apps.bdimg.com/libs/bootstrap/3.3.0/css/bootstrap.min.css">   <Scriptsrc= "Http://apps.bdimg.com/libs/jquery/2.1.1/jquery.min.js"></Script>   <Scriptsrc= "Http://apps.bdimg.com/libs/bootstrap/3.3.0/js/bootstrap.min.js"></Script></Head><Body><Divclass= "Row">   <Divclass= "center-block"style= "Width:200px;background-color: #ccc;">This is a Center-block instance</Div></Div></Body></HTML>

The results are as follows:

Show and hide content

You can force set elements to be displayed or hidden (including screen readers) by using class. Show and. Hidden.

<Divclass= "Row"style= "padding:91px 100px 19px 50px;">   <Divclass= "Show"style= "Left-margin:10px;width:300px;background-color: #ccc;">This is a example for show class</Div>   <Divclass= "hidden"style= "Width:200px;background-color: #ccc;">This is a example for hide class</Div></Div>

The results are as follows:

Screen reader

You can hide elements on all devices, except screen readers, by using class. Sr-only.

<Divclass= "Row"style= "padding:91px 100px 19px 50px;">   <formclass= "Form-inline"role= "form">   <Divclass= "Form-group">      <labelclass= "Sr-only" for= "Email">Email address</label>      <inputtype= "Email"class= "Form-control"placeholder= "Enter Email">   </Div>   <Divclass= "Form-group">      <labelclass= "Sr-only" for= "Pass">Password</label>      <inputtype= "Password"class= "Form-control"placeholder= "Password">   </Div></Div>

The results are as follows:

Here we see a label label of two input types with class sr-only, so the label will be visible only to screen readers.

Close icon

Use the generic close icon to close the modal box and the warning box. Use class close to get the close icon.

 <  p  >  close Icon Example  <  button  type  = "button"   class  = "Close"   Aria-hidden  = "true"  > //aria-hidden is for screen readers, &times is an HTML entity that represents a "   Multiplication Sign "  &times;  </ button  >  </ p  >  

The results are as follows:

Insert character

Use the caret to represent the drop-down function and orientation. Use the <span> element with class caret to get this functionality.

< P > Caret Instance    <  class= "Caret"></span></p  >

The results are as follows:

Bootstrap--CSS--auxiliary class

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.