新聞中心
Bootstrap4 顏色
Bootstrap 4 提供了一些有代表意義的顏色類(lèi):.text-muted, .text-primary, .text-success, .text-info, .text-warning, .text-danger, .text-secondary, .text-white, .text-dark and .text-light:

目前創(chuàng)新互聯(lián)建站已為近1000家的企業(yè)提供了網(wǎng)站建設(shè)、域名、網(wǎng)頁(yè)空間、網(wǎng)站運(yùn)營(yíng)、企業(yè)網(wǎng)站設(shè)計(jì)、玉山網(wǎng)站維護(hù)等服務(wù),公司將堅(jiān)持客戶導(dǎo)向、應(yīng)用為本的策略,正道將秉承"和諧、參與、激情"的文化,與客戶和合作伙伴齊心協(xié)力一起成長(zhǎng),共同發(fā)展。
實(shí)例
<
div
class
=
"
container
"
>
<
h2
>
代表指定意義的文本顏色
h2
>
<
p
class
=
"
text-muted
"
>
柔和的文本。
p
>
<
p
class
=
"
text-primary
"
>
重要的文本。
p
>
<
p
class
=
"
text-success
"
>
執(zhí)行成功的文本。
p
>
<
p
class
=
"
text-info
"
>
代表一些提示信息的文本。
p
>
<
p
class
=
"
text-warning
"
>
警告文本。
p
>
<
p
class
=
"
text-danger
"
>
危險(xiǎn)操作文本。
p
>
<
p
class
=
"
text-secondary
"
>
副標(biāo)題。
p
>
<
p
class
=
"
text-dark
"
>
深灰色文字。
p
>
<
p
class
=
"
text-light
"
>
淺灰色文本(白色背景上看不清楚)。
p
>
<
p
class
=
"
text-white
"
>
白色文本(白色背景上看不清楚)。
p
>
div
>
嘗試一下 ?
在鏈接中使用
實(shí)例
<
div
class
=
"
container
"
>
<
h2
>
文本顏色
h2
>
<
p
>
鼠標(biāo)移動(dòng)到鏈接。
p
>
<
a
href
=
"
#
"
class
=
"
text-muted
"
>
柔和的鏈接。
a
>
<
a
href
=
"
#
"
class
=
"
text-primary
"
>
主要鏈接。
a
>
<
a
href
=
"
#
"
class
=
"
text-success
"
>
成功鏈接。
a
>
<
a
href
=
"
#
"
class
=
"
text-info
"
>
信息文本鏈接。
a
>
<
a
href
=
"
#
"
class
=
"
text-warning
"
>
警告鏈接。
a
>
<
a
href
=
"
#
"
class
=
"
text-danger
"
>
危險(xiǎn)鏈接。
a
>
<
a
href
=
"
#
"
class
=
"
text-secondary
"
>
副標(biāo)題鏈接。
a
>
<
a
href
=
"
#
"
class
=
"
text-dark
"
>
深灰色鏈接。
a
>
<
a
href
=
"
#
"
class
=
"
text-light
"
>
淺灰色鏈接。
a
>
div
>
嘗試一下 ?
背景顏色
提供背景顏色的類(lèi)有: .bg-primary, .bg-success, .bg-info, .bg-warning, .bg-danger, .bg-secondary, .bg-dark 和 .bg-light。
注意背景顏色不會(huì)設(shè)置文本的顏色,在一些實(shí)例中你需要與 .text-* 類(lèi)一起使用。
實(shí)例
<
div
class
=
"
container
"
>
<
h2
>
背景顏色
h2
>
<
p
class
=
"
bg-primary text-white
"
>
重要的背景顏色。
p
>
<
p
class
=
"
bg-success text-white
"
>
執(zhí)行成功背景顏色。
p
>
<
p
class
=
"
bg-info text-white
"
>
信息提示背景顏色。
p
>
<
p
class
=
"
bg-warning text-white
"
>
警告背景顏色
p
>
<
p
class
=
"
bg-danger text-white
"
>
危險(xiǎn)背景顏色。
p
>
<
p
class
=
"
bg-secondary text-white
"
>
副標(biāo)題背景顏色。
p
>
<
p
class
=
"
bg-dark text-white
"
>
深灰背景顏色。
p
>
<
p
class
=
"
bg-light text-dark
"
>
淺灰背景顏色。
p
>
div
>
嘗試一下 ?
分享題目:創(chuàng)新互聯(lián)Bootstrap4教程:Bootstrap4 顏色
新聞來(lái)源:http://fisionsoft.com.cn/article/djciihp.html


咨詢
建站咨詢
