【问题标题】:How to change properties of only the outer borders of bootstrap tables如何仅更改引导表外边界的属性
【发布时间】:2021-02-22 05:31:00
【问题描述】:

我想更改 border-colorborder-styleborder-radius 之类的 border 属性,只有 bootstrap 4 表的外边框,我试过了,但它不起作用,也许属性被覆盖了。这是我的代码

<!DOCTYPE html>
<html lang="en">
<head>
  <title>Bootstrap Example</title>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css">
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.16.0/umd/popper.min.js"></script>
  <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js"></script>
</head>
<body>

<div class="container">            
  <table class="table table-bordered">
    <thead>
      <tr>
        <th>Firstname</th>
        <th>Lastname</th>
        <th>Email</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td>John</td>
        <td>Doe</td>
        <td>john@example.com</td>
      </tr>
      <tr>
        <td>Mary</td>
        <td>Moe</td>
        <td>mary@example.com</td>
      </tr>
      <tr>
        <td>July</td>
        <td>Dooley</td>
        <td>july@example.com</td>
      </tr>
    </tbody>
  </table>
</div>

</body>
</html>

【问题讨论】:

标签: html css bootstrap-4 frontend


【解决方案1】:

您可以通过编辑引导 css 文件或在 &lt;head&gt; 标签中使用 &lt;style&gt; 来更改默认样式。

【讨论】:

  • 我正在使用 cdn,我尝试设置样式但它不起作用,当我尝试在开发人员模式下检查它是否被其他样式覆盖时,我不确定那是什么
  • 你为什么不试试内联css?
  • 我总是尝试将我的样式与我的标记分开,这就是为什么我通常不使用内联样式
  • 你是对的,但你应该选择内联样式或 CDN
  • 是的,我想我必须为此深入研究引导库并弄清楚如何才能达到预期的结果,顺便说一句,谢谢您的推荐,
猜你喜欢
  • 2015-06-11
  • 2018-07-04
  • 2016-06-23
  • 1970-01-01
  • 2016-01-29
  • 1970-01-01
  • 2017-10-02
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多