---
title: "Bootstrap组件--警告框"
author: "小丑鱼0703"
date: "2015-02-05T11:53:30Z"
tags: []
categories: ["Web前端"]
slug: "bootstrap"
draft: false
lastmod: "2015-03-09T15:15:36Z"
id: 2183596
url: "https://wangjingyi.iteye.com/blog/2183596"
---

```html

    <div class="bs-docs-example">
      <div class="alert alert-block alert-error fade in">
<!--将data-dismiss="alert"添加到关闭按钮即可自动赋予某个警告框关闭的功能-->
        <button type="button" class="close" data-dismiss="alert">&times;</button>
        <h4 class="alert-heading">Oh snap! You got an error!</h4>
        <p>Change this and that and try again. Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit.</p>
        <p>
          <a class="btn btn-danger" href="#">Take this action</a>
          <a class="btn" href="#">Or do this</a>
        </p>
      </div>
    </div>

```


![](http://dl2.iteye.com/upload/attachment/0105/8656/1a965cc4-e84a-3dd7-ba06-be62f354d9ab.jpg)
<http://v2.bootcss.com/components.html#alerts>