Bootstrap 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.
คลาสข้อความตามบริบทยังสามารถใช้กับลิงก์ ซึ่งจะเพิ่มสีโฮเวอร์ที่เข้มกว่า:
ตัวอย่าง
คุณยังสามารถเพิ่มความทึบ 50% สำหรับข้อความสีดำหรือสีขาวด้วย.text-black-50
or .text-white-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.