Bootstrap 4 colori
Colori del testo
Bootstrap 4 ha alcune classi contestuali che possono essere utilizzate per fornire "significato attraverso i colori".
Le classi per i colori del testo sono: .text-muted
,
.text-primary
, .text-success
, .text-info
,
.text-warning
, .text-danger
, .text-secondary
, .text-white
,
.text-dark
, .text-body
(colore del corpo predefinito/spesso nero) e .text-light
:
Esempio
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.
Le classi di testo contestuali possono essere utilizzate anche sui collegamenti, che aggiungeranno un colore al passaggio del mouse più scuro:
Esempio
Puoi anche aggiungere il 50% di opacità per il testo in bianco o nero con le classi .text-black-50
o :.text-white-50
Esempio
Black text with 50% opacity on white background
White text with 50% opacity on black background
Colori di sfondo
Le classi per i colori di sfondo sono: .bg-primary
,
.bg-success
, .bg-info
, .bg-warning
, .bg-danger
, .bg-secondary
, .bg-dark
e .bg-light
.
Nota che i colori di sfondo non impostano il colore del testo, quindi in alcuni casi ti consigliamo di usarli insieme a una .text-*
classe.
Esempio
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.