Bootstrap4 タイポグラフィ


Bootstrap 4 デフォルト設定

Bootstrap 4 デフォルトのfont-size16px は、line-height1.5 です。

デフォルトのfont-family"Helvetica Neue"、Helvetica、Arial、sans-serif です。

さらに、すべての<p>元素margin-top: 0 、 margin-bottom: 1rem (16px)。


<h1> - <h6>

Bootstrap ではすべての HTML 見出し(h1 から h6)のスタイルが定義されています。次の例を参照してください:

实例

<div class="container"> <h1>h1 Bootstrap 标题 (2.5rem = 40px)</h1> <h2>h2 Bootstrap 标题 (2rem = 32px)</h2> <h3>h3 Bootstrap 标题 (1.75rem = 28px)</h3> <h4>h4 Bootstrap 标题 (1.5rem = 24px)</h4> <h5>h5 Bootstrap 标题 (1.25rem = 20px)</h5> <h6>h6 Bootstrap 标题 (1rem = 16px)</h6> </div>

尝试一下 »

Display 見出しクラス

Bootstrap はさらに、見出しのスタイルを制御するための 4 つの Display クラスを提供しています: .display-1, .display-2, .display-3, .display-4。

实例

<div class="container"> <h1>Display 标题</h1> <p>Display 見出しは、より大きく太いフォントスタイルで出力できます。</p> <h1 class="display-1">Display 1</h1> <h1 class="display-2">Display 2</h1> <h1 class="display-3">Display 3</h1> <h1 class="display-4">Display 4</h1> </div>

尝试一下 »

<small>

Bootstrap 4 におけるHTML<small>要素は、より小さいフォントサイズでより薄い色のテキストを作成するために使用されます:

实例

<div class="container"> <h1>更小文本标题</h1> <p>small 要素は、より小さいフォントサイズとより薄い色のテキストに使用されます:</p> <h1>h1 标题<small>副标题</small></h1> <h2>h2 标题<small>副标题</small></h2> <h3>h3 标题<small>副标题</small></h3> <h4>h4 标题<small>副标题</small></h4> <h5>h5 标题<small>副标题</small></h5> <h6>h6 标题<small>副标题</small></h6> </div>

尝试一下 »

<mark>

Bootstrap 4 定义<mark>黄色背景にし、一定の内側余白(パディング)を設ける

实例

<div class="container"> <h1>高亮文本</h1> <p>使用 mark 元素来<mark>高亮</mark>文本。</p> </div>

尝试一下 »

<abbr>

Bootstrap 4 定义 HTML<abbr>要素のスタイルは、テキストの下部に表示される点線の枠線です

实例

<div class="container"> <h1>Abbreviations</h1> <p>The abbr element is used to mark up an abbreviation or acronym:</p> <p>The <abbr title="World Health Organization">WHO</abbr> was founded in 1948.</p> </div>

尝试一下 »

<blockquote>

引用した内容については、次のことができます<blockquote>上添加.blockquote类 :

实例

<div class="container"> <h1>Blockquotes</h1> <p>The blockquote element is used to present content from another source:</p> <blockquote class="blockquote"> <p>For 50 years, WWF has been protecting the future of nature. The world's leading conservation organization, WWF works in 100 countries and is supported by 1.2 million members in the United States and close to 5 million globally.</p> <footer class="blockquote-footer">From WWF's website</footer> </blockquote> </div>

尝试一下 »

<dl>

Bootstrap 4 定义 HTML<dl>要素のスタイルは次のとおりです:

实例

<div class="container"> <h1>Description Lists</h1> <p>The dl element indicates a description list:</p> <dl> <dt>Coffee</dt> <dd>- black hot drink</dd> <dt>Milk</dt> <dd>- white cold drink</dd> </dl> </div>

尝试一下 »

<code>

Bootstrap 4 定义 HTML<code>要素のスタイルは次のとおりです:

实例

<div class="container"> <h1>代码片段</h1> <p>可以将一些代码元素放到 code 元素里面:</p> <p>以下 HTML 元素:<code>span</code>, <code>section</code>、および<code>div</code>用于定义部分文档内容。</p> </div>

尝试一下 »

<kbd>

Bootstrap 4 定义 HTML<kbd>要素のスタイルは次のとおりです:

实例

<div class="container"> <h1>Keyboard Inputs</h1> <p>To indicate input that is typically entered via the keyboard, use the kbd element:</p> <p>Use <kbd>ctrl + p</kbd> to open the Print dialog box.</p> </div>

尝试一下 »

<pre>

Bootstrap 4 定义 HTML<pre>要素のスタイルは次のとおりです:

实例

<div class="container"> <h1>Multiple Code Lines</h1> <p>For multiple lines of code, use the pre element:</p> <pre> Text in a pre element is displayed in a fixed-width font, and it preserves both spaces and line breaks. </pre> </div>

尝试一下 »

更多排版类

次の表は、Bootstrap4 のその他のタイポグラフィクラスの例を示しています:

类名 描述 实例
.font-weight-bold 加粗文本 尝试一下
.font-weight-normal 普通文本 尝试一下
.font-weight-light より細かいテキスト 尝试一下
.font-italic 斜体文本 尝试一下
.lead 段落をより目立たせる 尝试一下
.small より小さいテキストを指定(親要素の85%) 尝试一下
.text-left 左揃え 尝试一下
.text-center 居中 尝试一下
.text-right 右揃え 尝试一下
.text-justify テキストの配置を設定し、段落内で画面からはみ出すテキストを自動的に折り返します 尝试一下
.text-nowrap 段落内で画面からはみ出る部分は改行しない 尝试一下
.text-lowercase テキストを小文字に設定 尝试一下
.text-uppercase テキストを大文字に設定 尝试一下
.text-capitalize 単語の最初の文字を大文字に設定 尝试一下
.initialism <abbr> 要素内に表示されるテキストを小さなフォントで表示し、小文字を大文字に変換することもできます 尝试一下
.list-unstyled デフォルトのリストスタイルを削除し、リスト項目を左揃えにします(<ul> および <ol> 内)。このクラスは直接の子リスト項目にのみ適用されます (ネストされたリスト項目を削除する必要がある場合は、ネストされたリストでこのスタイルを使用する必要があります) 尝试一下
.list-inline すべてのリスト項目を同じ行に配置する 尝试一下
.pre-scrollable <pre> 要素をスクロール可能にします。コードブロック領域の最大高さは340pxで、この高さを超えるとY軸にスクロールバーが表示されます 尝试一下
其他扩展