在bootstrap中设置btn-group中的边距

时间:2017-07-09 04:33:22

标签: twitter-bootstrap

如何在btn-group bootstrap中一般添加上边距和边距。我应该添加什么课程?提前致谢

如何在btn-group bootstrap中一般添加上边距和边距。我应该添加什么课程?提前致谢

btn-group

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <title>Golden Titles</title>

    <meta name="description" content="Source code">
    <meta name="author" content="Rahman">

    <link href="css/bootstrap.min.css" rel="stylesheet">
    <link href="css/style.css" rel="stylesheet">

  </head>
  <body>

    <div class="container-fluid">
    <div class="row">
        <div class="col-md-12">
            <div class="btn-group pull-right">

                <button class="btn btn-default" type="button">
                    Sign in
                </button> 
                <button class="btn btn-default" type="button">
                    My Account
                </button> 
                <button class="btn btn-default" type="button">
                    Help
                </button> 

            </div>
        </div>
    </div>
</div>

    <script src="js/jquery.min.js"></script>
    <script src="js/bootstrap.min.js"></script>
    <script src="js/scripts.js"></script>
  </body>
</html>

1 个答案:

答案 0 :(得分:1)

  1. 添加新的css文件(customized-bootstrap.css)
  2. 将以下代码附加到此文件中:

    .btn-group button {
        top-margin: 1em !important;
    }
    
  3. 在布局页面

    中的bootstrap文件后添加此文件
    <link href="../../dist/css/bootstrap.min.css" rel="stylesheet">
    <link href="../css/customized-bootstrap.css" rel="stylesheet">