新聞中心
Bootstrap 警告(Alerts)
本章將講解警告(Alerts)以及 Bootstrap 所提供的用于警告的 class。警告(Alerts)向用戶提供了一種定義消息樣式的方式。它們?yōu)榈湫偷挠脩舨僮魈峁┝松舷挛男畔⒎答仭?/p>

浦城網(wǎng)站建設公司創(chuàng)新互聯(lián)公司,浦城網(wǎng)站設計制作,有大型網(wǎng)站制作公司豐富經(jīng)驗。已為浦城近千家提供企業(yè)網(wǎng)站建設服務。企業(yè)網(wǎng)站搭建\成都外貿(mào)網(wǎng)站建設公司要多少錢,請找那個售后服務好的浦城做網(wǎng)站的公司定做!
您可以為警告框添加一個可選的關(guān)閉按鈕。為了創(chuàng)建一個內(nèi)聯(lián)的可取消的警告框,請使用 警告(Alerts) jQuery 插件。
您可以通過創(chuàng)建一個
實例
<
div
class
=
"
alert alert-success
"
>
成功!很好地完成了提交。
div
>
<
div
class
=
"
alert alert-info
"
>
信息!請注意這個信息。
div
>
<
div
class
=
"
alert alert-warning
"
>
警告!請不要提交。
div
>
<
div
class
=
"
alert alert-danger
"
>
錯誤!請進行一些更改。
div
>
嘗試一下 ?
結(jié)果如下所示:
可取消的警告(Dismissal Alerts)
創(chuàng)建一個可取消的警告(Dismissal Alert)步驟如下:
- 通過創(chuàng)建一個 ,并向其添加一個 .alert class 和四個上下文 class(即 .alert-success、.alert-info、.alert-warning、.alert-danger)之一,來添加一個基本的警告框。
- 同時向上面的
class 添加可選的 .alert-dismissable。- 添加一個關(guān)閉按鈕。
下面的實例演示了這點:
實例
<
div
class
=
"
alert alert-success alert-dismissable
"
>
<
button
type
=
"
button
"
class
=
"
close
"
data-dismiss
=
"
alert
"
aria-hidden
=
"
true
"
>
×
button
>
成功!很好地完成了提交。
div
>
<
div
class
=
"
alert alert-info alert-dismissable
"
>
<
button
type
=
"
button
"
class
=
"
close
"
data-dismiss
=
"
alert
"
aria-hidden
=
"
true
"
>
×
button
>
信息!請注意這個信息。
div
>
<
div
class
=
"
alert alert-warning alert-dismissable
"
>
<
button
type
=
"
button
"
class
=
"
close
"
data-dismiss
=
"
alert
"
aria-hidden
=
"
true
"
>
×
button
>
警告!請不要提交。
div
>
<
div
class
=
"
alert alert-danger alert-dismissable
"
>
<
button
type
=
"
button
"
class
=
"
close
"
data-dismiss
=
"
alert
"
aria-hidden
=
"
true
"
>
×
button
>
錯誤!請進行一些更改。
div
>請確保使用帶有
data-dismiss="alert" data 屬性的嘗試一下 ?
結(jié)果如下所示:
警告(Alerts)中的鏈接
在警告(Alerts)中創(chuàng)建鏈接的步驟如下:
- 通過創(chuàng)建一個 ,并向其添加一個 .alert class 和四個上下文 class(即 .alert-success、.alert-info、.alert-warning、.alert-danger)之一,來添加一個基本的警告框。
- 使用 .alert-link 實體類來快速提供帶有匹配顏色的鏈接。
實例
<
div
class
=
"
alert alert-success
"
>
<
a
href
=
"
#
"
class
=
"
alert-link
"
>
成功!很好地完成了提交。
a
>
div
>
<
div
class
=
"
alert alert-info
"
>
<
a
href
=
"
#
"
class
=
"
alert-link
"
>
信息!請注意這個信息。
a
>
div
>
<
div
class
=
"
alert alert-warning
"
>
<
a
href
=
"
#
"
class
=
"
alert-link
"
>
警告!請不要提交。
a
>
div
>
<
div
class
=
"
alert alert-danger
"
>
<
a
href
=
"
#
"
class
=
"
alert-link
"
>
錯誤!請進行一些更改。
a
>
div
>
嘗試一下 ?結(jié)果如下所示:
當前題目:創(chuàng)新互聯(lián)Bootstrap教程:Bootstrap警告(Alerts)
網(wǎng)站路徑:http://www.5511xx.com/article/dpesecd.html
- 同時向上面的


咨詢
建站咨詢
