Bootstrap 4 barvy
Barvy textu
Bootstrap 4 má některé kontextové třídy, které lze použít k poskytnutí „významu prostřednictvím barev“.
Třídy pro barvy textu jsou: .text-muted
,
.text-primary
, .text-success
, .text-info
,
.text-warning
, .text-danger
, .text-secondary
, .text-white
,
.text-dark
, .text-body
(výchozí barva těla/často černá) a .text-light
:
Příklad
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.
Kontextové textové třídy lze také použít na odkazy, které přidají tmavší barvu přechodu:
Příklad
Můžete také přidat 50% neprůhlednost pro černý nebo bílý text pomocí tříd .text-black-50
nebo :.text-white-50
Příklad
Black text with 50% opacity on white background
White text with 50% opacity on black background
Barvy pozadí
Třídy pro barvy pozadí jsou : .bg-primary
,
.bg-success
, .bg-info
, .bg-warning
, .bg-danger
, .bg-secondary
a .bg-dark
..bg-light
Všimněte si, že barvy pozadí nenastavují barvu textu, takže v některých případech je budete chtít použít společně s .text-*
třídou.
Příklad
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.