使用灰色轮廓的 Bootstrap 4 按钮设置不太重要的内容

bootstrapweb developmentcss framework

要在 Bootstrap 中设置不太重要的内容,请使用 btn-outline-secondary 类。

在按钮上应用轮廓,并使用相同的类 − 将其应用为绿色。

<button type="button" class="btn btn-outline-secondary">
  Tools (Secondary Outline)
</button>

上面,我将 btn-outline-secondary 类设置为任何元素上设置的普通类,此处为 button。

您可以尝试运行以下代码,了解如何设置灰色轮廓的 Bootstrap 按钮 −

示例

<!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.1.0/css/bootstrap.min.css">
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.1.0/js/bootstrap.min.js"></script>
  </head>
<body>
  <h2>Web Tools</h2>
  <p>The following are the Tools:</p>
  <ul class = "list-group">
    <li class = "list-group-item">JSON Editor</li>
    <li class = "list-group-item">XML Editor</li>
  </ul>
  <p>For more, click below:</p>
  <button type="button" class="btn btn-outline-secondary"> Tools (Secondary Outline)</button>

</body>
</html>

相关文章