Bootstrap 警告框短代码

用于生成带有样式、标题和 Markdown 语法的警告框的短代码。

警告框

警告框参数

style

索引名称类型必填默认值版本示例
#0stylestring-primary--

primarysecondarysuccessdangerwarninginfolightdark

警告框样式

源码
 1{{< bs/alert primary >}}
 2A simple primary alert—check it out!
 3{{< /bs/alert >}}
 4
 5{{< bs/alert secondary >}}
 6A simple secondary alert—check it out!
 7{{< /bs/alert >}}
 8
 9{{< bs/alert success >}}
10A simple success alert—check it out!
11{{< /bs/alert >}}
12
13{{< bs/alert danger >}}
14A simple danger alert—check it out!
15{{< /bs/alert >}}
16
17{{< bs/alert warning >}}
18A simple warning alert—check it out!
19{{< /bs/alert >}}
20
21{{< bs/alert info >}}
22A simple info alert—check it out!
23{{< /bs/alert >}}
24
25{{< bs/alert light >}}
26A simple light alert—check it out!
27{{< /bs/alert >}}
28
29{{< bs/alert dark >}}
30A simple dark alert—check it out!
31{{< /bs/alert >}}
结果

带有 Markdown 内容的警告框

源码
1{{% bs/alert style=primary %}}
2A simple *primary alert* with Markdown—**check it out**!
3{{% /bs/alert %}}
结果

警告链接

bs/alert-link 允许于警告框内插入一个样式化的链接。

警告链接参数

text

索引名称类型必填默认值版本示例
#0textstring---

链接文本。

url

索引名称类型必填默认值版本示例
#1urlstring---

链接地址。

警告链接示例

源码
1{{< bs/alert >}}
2A simple primary alert with {{< bs/alert-link "an example link" "#alert-link" >}}. Give it a click if you like.
3{{< /bs/alert >}}
4
5{{< bs/alert warning >}}
6A simple warning alert with {{< bs/alert-link "an example link" "#alert-link" >}}. Give it a click if you like.
7{{< /bs/alert >}}
结果

警告框标题

bs/alert-heading 用于为警告框添加标题。

警告框标题参数

title

索引名称类型必填默认值版本示例
#0titlestring---

标题。

警告框标题示例

源码
1{{% bs/alert success %}}
2{{< bs/alert-heading "Well done!" >}}
3Aww yeah, you _successfully_ read this important alert message. This example text is going to run a bit longer so that you can see how spacing within an alert works with this kind of content.
4{{% /bs/alert %}}
结果