html - 将 Bootstrap CSS 与自定义 CSS 结合使用——这种做法不好吗?

标签 html css twitter-bootstrap-3

<分区>


想要改进这个问题? 更新问题,以便 editing this post 可以用事实和引用来回答它.

关闭 6 年前

如果我放置一个带有标准 Bootstrap CSS 的按钮,而不是在其上应用自定义 CSS,这是不好的做法吗?

我应该完全放弃 Bootstrap 并只使用自定义吗?如果是这样,储蓄的成本是多少?我有另一位 web 开发人员 告诉我,这些额外的类在编译网页时产生了开销。我个人认为微不足道的速度如何衡量?

这是一个链接看起来像按钮的示例,使用 Bootstrap css 类:

  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
  <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>

<style>
      .custom-btn-css{
        font-size: 16px;
        font-weight: bold;
        border-radius: 30px;
        border-width: 0;
        margin-top: 15px;
        padding: 10px 32px;
        color: white;
    }
</style>

<div class="container">
  <a  class="btn btn-primary btn-large custom-btn-css" href="#">Button Example</a>
</div>

最佳答案

没有问题,首先你需要看看这个linik

https://stackoverflow.com/a/26640525/6572922

然后你需要引用 How to Easily Add Custom CSS to Bootstrap with Examples

http://www.kodingmadesimple.com/2015/01/add-custom-css-to-bootstrap-examples.html

这个链接可以解开你的疑惑

关于html - 将 Bootstrap CSS 与自定义 CSS 结合使用——这种做法不好吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41591000/

上一篇:javascript - 使用复选框(过滤)根据下拉列表中的多个选择隐藏/显示行

下一篇:html - 如何使用左右浮动和垂直居中对齐?

相关文章:

css - 无法在 Bootstrap 中对齐详细信息页面的静态字段

javascript - 使用 JavaScript 刷新时,PHP 会丢失其数据

用于显示/隐藏组中特定 div 的 Javascript

ios - 图像中的 Bootstrap Modal 在 iOS 中不起作用

php - 单击图像时如何在php变量中获取img标签的id?

html - 如何防止两列内容重叠

jquery - Bootstrap 3折叠 Accordion : collapse all works but then cannot expand all while maintaining data-parent

Javascript检测表格单元格边框?

html - 我的跨度漂浮在后面 - 我需要它在上面

javascript - Bootstrap 3 导航栏 header 在移动设备上不可点击/响应