样式通过关键字class来指定不同的效果

    1. <!DOCTYPE html>
    2. <html lang="en">
    3. <head>
    4. <meta charset="UTF-8">
    5. <title>Title</title>
    6. <style>
    7. </style>
    8. <link rel="stylesheet" href="dist/css/bootstrap.css">
    9. </head>
    10. <body>
    11. <div class="container">
    12. <div class="row">
    13. <div class="col-md-8 col-md-offset-2">
    14. <table border="1" class="table table-striped table-hover table-bordered">
    15. <tr>
    16. <th>序号</th>
    17. <th>姓名</th>
    18. <th>年龄</th>
    19. <th>部门</th>
    20. </tr>
    21. <tr class="success">
    22. <td>1</td>
    23. <td>张三</td>
    24. <td>23</td>
    25. <td>销售</td>
    26. </tr>
    27. <tr>
    28. <td>2</td>
    29. <td>李四</td>
    30. <td>23</td>
    31. <td>销售</td>
    32. </tr>
    33. <tr class="danger">
    34. <td>3</td>
    35. <td>王五</td>
    36. <td>23</td>
    37. <td>销售</td>
    38. </tr>
    39. </table>
    40. </div>
    41. </div>
    42. <div class="row">
    43. <div class="col-md-8 col-md-offset-2">
    44. <form>
    45. <div class="form-group">
    46. <label for="exampleInputEmail1">Email address</label>
    47. <input type="email" class="form-control" id="exampleInputEmail1" placeholder="Email">
    48. </div>
    49. <div class="form-group">
    50. <label for="exampleInputPassword1">Password</label>
    51. <input type="password" class="form-control" id="exampleInputPassword1" placeholder="Password">
    52. </div>
    53. <div class="form-group">
    54. <label for="exampleInputFile">File input</label>
    55. <input type="file" id="exampleInputFile">
    56. <p class="help-block">Example block-level help text here.</p>
    57. </div>
    58. <div class="checkbox">
    59. <label>
    60. <input type="checkbox"> Check me out
    61. </label>
    62. </div>
    63. <button type="submit" class="btn btn-default">Submit</button>
    64. </form>
    65. <hr>
    66. <form action="">
    67. <div class="form-group">
    68. <label for="user">用户名</label>
    69. <input type="text" class="form-control" id="user">
    70. </div>
    71. <div class="form-group">
    72. <label for="pwd">密码</label>
    73. <input type="password" class="form-control" id="pwd">
    74. </div>
    75. <div class="form-group">
    76. <div class="row">
    77. <div class="col-md-6">
    78. <select class="form-control">
    79. <option>1</option>
    80. <option>2</option>
    81. <option>3</option>
    82. <option>4</option>
    83. <option>5</option>
    84. </select>
    85. </div>
    86. </div>
    87. </div>
    88. <div class="row">
    89. <div class="col-md-2 pull-right"><input type="submit" class="form-control"></div>
    90. </div>
    91. </form>
    92. </div>
    93. </div>
    94. <div class="col-md-8 col-md-offset-2">
    95. <div class="row">
    96. <h3>按钮</h3>
    97. <button class="btn btn-danger btn-sm" disabled="disabled">button</button>
    98. <input class="btn btn-warning btn-lg" type="button" value="button">
    99. <span class="glyphicon glyphicon-user"></span>&nbsp;&nbsp;&nbsp;
    100. <span class="glyphicon glyphicon-shopping-cart"></span>
    101. </div>
    102. </div>
    103. </div>
    104. </body>
    105. </html>