ブートストラップ4色
テキストの色
Bootstrap 4には、「色による意味」を提供するために使用できるコンテキストクラスがいくつかあります。
テキストの色のクラスは次のとおりです。、、、、、、、、、、、(デフォルトの.text-muted
ボディ
カラー/
多くの
場合黒)および:.text-primary
.text-success
.text-info
.text-warning
.text-danger
.text-secondary
.text-white
.text-dark
.text-body
.text-light
例
This text is muted.
This text is important.
This text indicates success.
This text represents some information.
This text represents a warning.
This text represents danger.
Secondary text.
Dark grey text.
Body text.
Light grey text.
リンクではコンテキストテキストクラスを使用することもできます。これにより、ホバーの色が暗くなります。
例
.text-black-50
または.text-white-50
クラスを使用して、黒または白のテキストに50%の不透明度を追加することもできます。
例
Black text with 50% opacity on white background
White text with 50% opacity on black background
背景色
背景色.bg-primary
のクラス
.bg-success
は、、、、、、、、、および.bg-info
です。.bg-warning
.bg-danger
.bg-secondary
.bg-dark
.bg-light
.text-*
背景色はテキストの色を設定しないため、クラスと一緒に使用したい場合があることに注意してください。
例
This text is important.
This text indicates success.
This text represents some information.
This text represents a warning.
This text represents danger.
Secondary background color.
Dark grey background color.
Light grey background color.