用于强调文本的 Bootstrap 类

bootstrapweb developmentcss framework更新于 2026/2/5 11:56:17

HTML 的默认强调标签,例如 <small> 将文本设置为父元素大小的 85%,<strong> 用较粗的字体强调文本,而 <em> 用斜体强调文本。

您可以尝试运行以下代码来强调文本 −

示例

<!DOCTYPE html>
<html>
   <head>
      <title>Bootstrap emphasis tags</title>
      <meta name="viewport" content="width=device-width, initial-scale=1">
      <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css">
      <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
      <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.1/js/bootstrap.min.js"></script>
   </head>
   <body>
      <small>This content is within tag</small><br>
      <strong>This content is within tag</strong><br>
      <em>This content is within tag and is rendered as italics</em><br>
      <p class = "text-left">Left aligned text.</p>
      <p class = "text-center">Center aligned text.</p>
      <p class = "text-right">Right aligned text.</p>
      <p class = "text-muted">This content is muted</p>
      <p class = "text-primary">This content carries a primary class</p>
      <p class = "text-danger">This content carries a danger class</p>
   </body>
</html>

相关文章