Bootstrap_全局CSS样式——按钮&图片、表格&表单

Bootstrap_全局CSS样式_按钮&图片

全局CSS样式:

  按钮:class="btn btn-default" 

  图片:

    class="img-responsive" : 图片在任意尺寸都占100%

    图片形状

    

<!-- 方形-->
<img src="img/banner_1.jpg" class="img-responsive img-rounded">
<!-- 圆形-->
<img src="img/banner_1.jpg" class="img-responsive img-circle">
<!-- 方框-->
<img src="img/banner_1.jpg" class="img-responsive img-thumbnail">

  

<!doctype html>
<html lang="zh-CN">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- 上述3个meta标签*必须*放在最前面,任何其他内容都*必须*跟随其后! -->
    <title>Bootstrap 101 Template</title>

    <!-- Bootstrap -->
    <link rel="stylesheet" href="css/bootstrap.min.css" integrity="sha384-HSMxcRTRxnN+Bdg0JdbxYKrThecOKuH5zCYotlSAcp1+c8xmyTe9GYg1l9a69psu" crossorigin="anonymous">

    <!-- jQuery (Bootstrap 的所有 JavaScript 插件都依赖 jQuery,所以必须放在前边) -->
    <script src="js/jquery-3.5.1.min.js" integrity="sha384-nvAa0+6Qg9clwYCGGPpDQLVpLNn0fRaROjHqs13t4Ggj3Ez50XnGQqc/r8MhnRDZ" crossorigin="anonymous"></script>
    <!-- 加载 Bootstrap 的所有 JavaScript 插件。你也可以根据需要只加载单个插件。 -->
    <script src="css/bootstrap.min.css" integrity="sha384-aJ21OjlMXNL5UyIl/XNwTMqvzeRMZH2w8c5cRVpzpU8Y5bApTppSuUkhZXN0VxHd" crossorigin="anonymous"></script>
    <style>

    </style>
</head>
<body>
    <a class="btn btn-default" href="#" role="button">Link</a>
    <button class="btn btn-default" type="submit">Button</button>
    <input class="btn btn-default" type="button" value="Input">
    <input class="btn btn-default" type="submit" value="Submit">
<br>
    <!-- Standard button -->
    <button type="button" class="btn btn-default">(默认样式)Default</button>

    <!-- Provides extra visual weight and identifies the primary action in a set of buttons -->
    <button type="button" class="btn btn-primary">(首选项)Primary</button>

    <!-- Indicates a successful or positive action -->
    <button type="button" class="btn btn-success">(成功)Success</button>

    <!-- Contextual button for informational alert messages -->
    <button type="button" class="btn btn-info">(一般信息)Info</button>

    <!-- Indicates caution should be taken with this action -->
    <button type="button" class="btn btn-warning">(警告)Warning</button>

    <!-- Indicates a dangerous or potentially negative action -->
    <button type="button" class="btn btn-danger">(危险)Danger</button>

    <!-- Deemphasize a button by making it look like a link while maintaining button behavior -->
    <button type="button" class="btn btn-link">(链接)Link</button>

<img src="img/banner_1.jpg" class="img-responsive">
<img src="img/banner_1.jpg" class="img-responsive img-rounded">
<img src="img/banner_1.jpg" class="img-responsive img-circle">
<img src="img/banner_1.jpg" class="img-responsive img-thumbnail">
</body>
</html>

  

Bootstrap_全局CSS样式_表格&表单

表格:table

      table-bordered

      table-hover

表单:

  给表单添加:class=" form-control "

<!doctype html>
<html lang="zh-CN">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- 上述3个meta标签*必须*放在最前面,任何其他内容都*必须*跟随其后! -->
    <title>Bootstrap 101 Template</title>

    <!-- Bootstrap -->
    <link rel="stylesheet" href="css/bootstrap.min.css" integrity="sha384-HSMxcRTRxnN+Bdg0JdbxYKrThecOKuH5zCYotlSAcp1+c8xmyTe9GYg1l9a69psu" crossorigin="anonymous">

    <!-- jQuery (Bootstrap 的所有 JavaScript 插件都依赖 jQuery,所以必须放在前边) -->
    <script src="js/jquery-3.5.1.min.js" integrity="sha384-nvAa0+6Qg9clwYCGGPpDQLVpLNn0fRaROjHqs13t4Ggj3Ez50XnGQqc/r8MhnRDZ" crossorigin="anonymous"></script>
    <!-- 加载 Bootstrap 的所有 JavaScript 插件。你也可以根据需要只加载单个插件。 -->
    <script src="css/bootstrap.min.css" integrity="sha384-aJ21OjlMXNL5UyIl/XNwTMqvzeRMZH2w8c5cRVpzpU8Y5bApTppSuUkhZXN0VxHd" crossorigin="anonymous"></script>
    <style>

    </style>
</head>
<body>
   <table class="table table-bordered table-hover">
       <tr>
           <th>编号</th>
           <th>姓名</th>
           <th>年龄</th>
       </tr>
       <tr>
           <th>001</th>
           <th>张三</th>
           <th>23</th>
       </tr>
       <tr>
           <th>002</th>
           <th>张三</th>
           <th>23</th>
       </tr>
       <tr>
           <th>003</th>
           <th>张三</th>
           <th>23</th>
       </tr>
   </table>
   <hr>
   <hr>
   <hr>

   <form class="form-horizontal">
       <div class="form-group">
           <label for="inputEmail3" class="col-sm-2 control-label">Email</label>
           <div class="col-sm-10">
               <input type="email" class="form-control" id="inputEmail3" placeholder="Email">
           </div>
       </div>
       <div class="form-group">
           <label for="inputPassword3" class="col-sm-2 control-label">Password</label>
           <div class="col-sm-10">
               <input type="password" class="form-control" id="inputPassword3" placeholder="Password">
           </div>
       </div>
       <div class="form-group">
           <div class="col-sm-offset-2 col-sm-10">
               <div class="checkbox">
                   <label>
                       <input type="checkbox"> Remember me
                   </label>
               </div>
           </div>
       </div>
       <div class="form-group">
           <div class="col-sm-offset-2 col-sm-10">
               <button type="submit" class="btn btn-default">Sign in</button>
           </div>
       </div>
   </form>
</body>
</html>

  

posted @ 2022-11-17 10:04  漁夫  阅读(24)  评论(0)    收藏  举报