ブートストラップ4テキスト/タイポグラフィ
ブートストラップ4のデフォルト設定
Bootstrap 4はデフォルト
font-size
の16pxを使用し、それ
line-height
は1.5です。
デフォルトfont-family
は「HelveticaNeue」、Helvetica、Arial、sans-serifです。
さらに、すべての<p>
要素に
はとがmargin-top: 0
ありmargin-bottom: 1rem
ます(デフォルトでは16px)。
<h1>-<h6>
Bootstrap 4は、フォントの太さが太く、フォントのサイズが大きくなっているHTML見出し( <h1>
〜
)のスタイルを設定します。<h6>
例
h1 Bootstrap heading (2.5rem = 40px)
h2 Bootstrap heading (2rem = 32px)
h3 Bootstrap heading (1.75rem = 28px)
h4 Bootstrap heading (1.5rem = 24px)
h5 Bootstrap heading (1.25rem = 20px)
h6 Bootstrap heading (1rem = 16px)
見出しを表示する
表示見出しは、通常の見出しよりも目立つように使用され(フォントサイズが大きく、フォントの太さが軽い)、4つのクラスから選択できます:.display-1
、、、.display-2
.display-3
.display-4
例
Display 1
Display 2
Display 3
Display 4
<小さい>
Bootstrap 4では、HTML<small>
要素を使用して、任意の見出しに軽量のセカンダリテキストを作成します。
例
h1 heading secondary text
h2 heading secondary text
h3 heading secondary text
h4 heading secondary text
h5 heading secondary text
h6 heading secondary text
<マーク>
<mark>
Bootstrap 4は、黄色の背景色といくつかのパディングを使用してHTML要素のスタイルを設定します。
例
Use the mark element to highlight text.
<略語>
Bootstrap 4は、<abbr>
下に点線の境界線でHTML要素のスタイルを設定します。
例
The WHO was founded in 1948.
<blockquote>
別のソースからコンテンツのブロックを引用.blockquote
するときに、クラスをに追加します。<blockquote>
例
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.
<dl>
Bootstrap 4は<dl>
、次の方法でHTML要素のスタイルを設定します。
例
- Coffee
- - black hot drink
- Milk
- - white cold drink
<コード>
Bootstrap 4は<code>
、次の方法でHTML要素のスタイルを設定します。
例
The following HTML elements: span
, section
, and div
defines a section in a document.
<kbd>
Bootstrap 4は<kbd>
、次の方法でHTML要素のスタイルを設定します。
例
Use ctrl + p to open the Print dialog box.
<pre>
Bootstrap 4は<pre>
、次の方法でHTML要素のスタイルを設定します。
例
is displayed in a fixed-width
font, and it preserves
both spaces and
line breaks.
その他のタイポグラフィクラス
以下のBootstrap4クラスを追加して、HTML要素のスタイルをさらに設定できます。
Class | Description | Example |
---|---|---|
.font-weight-bold |
Bold text | |
.font-weight-bolder |
Bolder text | |
.font-italic |
Italic text | |
.font-weight-light |
Light weight text | |
.font-weight-lighter |
Lighter weight text | |
.font-weight-normal |
Normal text | |
.lead |
Makes a paragraph stand out | |
.small |
Indicates smaller text (set to 80% of the size of the parent) | |
.text-left |
Indicates left-aligned text | |
.text-*-left |
Indicates left-aligned text on small, medium, large or xlarge screens | |
.text-break |
Prevents long text from breaking layout | |
.text-center |
Indicates center-aligned text | |
.text-*-center |
Indicates center-aligned text on small, medium, large or xlarge screens | |
.text-decoration-none |
Removes the underline from a link | |
.text-right |
Indicates right-aligned text | |
.text-*-right |
Indicates right-aligned text on small, medium, large or xlarge screens | |
.text-justify |
Indicates justified text | |
.text-monospace |
Monospaced text | |
.text-nowrap |
Indicates no wrap text | |
.text-lowercase |
Indicates lowercased text | |
.text-reset |
Resets the color of a text or a link (inherits the color from its parent) | |
.text-uppercase |
Indicates uppercased text | |
.text-capitalize |
Indicates capitalized text | |
.initialism |
Displays the text inside an <abbr> element in a slightly smaller font size |
|
.list-unstyled |
Removes the default list-style and left margin on list items (works on both <ul> and <ol> ). This class only applies to immediate children list items (to remove the default list-style from any nested lists, apply this class to any nested lists as well) |
|
.list-inline |
Places all list items on a single line (used together with
.list-inline-item on each <li> elements) |
|
.pre-scrollable |
Makes a <pre> element scrollable |
完全なBootstrap4CSSリファレンス
Bootstrap 4で利用可能なすべてのCSSクラスの完全なリファレンスについては、 Bootstrap4のすべてのクラスリファレンスにアクセスしてください。