Bootstrap tag
This chapter will explain Bootstrap tags. Labels can be used for counts, reminders, or other markup displays on the page. Use class .label to display labels, as shown in the following example:
Instance
<!DOCTYPE html> <html> <head> <title>Bootstrap 实例 - 标签</title> <link href="http://libs.baidu.com/bootstrap/3.0.3/css/bootstrap.min.css" rel="stylesheet"> <script src="http://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script> <script src="http://libs.baidu.com/bootstrap/3.0.3/js/bootstrap.min.js"></script> </head> <body> <h1>Example Heading <span class="label label-default">Label</span></h1> <h2>Example Heading <span class="label label-default">Label</span></h2> <h3>Example Heading <span class="label label-default">Label</span></h3> <h4>Example Heading <span class="label label-default">Label</span></h4> </body> </html>
Run Example »
Click the "Run Instance" button to view the online instance
You can use modified classes label-default, label-primary, label-success, label-info, label -warning, label-danger to change the appearance of the label, as shown in the following example:
Instance
<!DOCTYPE html> <html> <head> <title>Bootstrap 实例 - 标签的变体</title> <link href="http://libs.baidu.com/bootstrap/3.0.3/css/bootstrap.min.css" rel="stylesheet"> <script src="http://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script> <script src="http://libs.baidu.com/bootstrap/3.0.3/js/bootstrap.min.js"></script> </head> <body> <span class="label label-default">默认标签</span> <span class="label label-primary">主要标签</span> <span class="label label-success">成功标签</span> <span class="label label-info">信息标签</span> <span class="label label-warning">警告标签</span> <span class="label label-danger">危险标签</span> </body> </html>
Run the example »
Click the "Run Instance" button to view the online instance