警告提示框:

警报是一组颜色控件(共八个颜色样式),可用于任何长度的文本,以及可选的关闭按钮,系统提供8个可用的正确的样式。

八种颜色样式:

  1. <div class="alert alert-primary" role="alert">
  2. A simple primary alert—check it out!
  3. </div>
  4. <div class="alert alert-secondary" role="alert">
  5. A simple secondary alert—check it out!
  6. </div>
  7. <div class="alert alert-success" role="alert">
  8. A simple success alert—check it out!
  9. </div>
  10. <div class="alert alert-danger" role="alert">
  11. A simple danger alert—check it out!
  12. </div>
  13. <div class="alert alert-warning" role="alert">
  14. A simple warning alert—check it out!
  15. </div>
  16. <div class="alert alert-info" role="alert">
  17. A simple info alert—check it out!
  18. </div>
  19. <div class="alert alert-light" role="alert">
  20. A simple light alert—check it out!
  21. </div>
  22. <div class="alert alert-dark" role="alert">
  23. A simple dark alert—check it out!
  24. </div>

关闭警告:

<div class="alert alert-warning alert-dismissible fade show" role="alert">
    <strong>Holy guacamole!</strong> You should check in on some of those fields below.
    <button type="button" class="close" data-dismiss="alert" aria-label="Close">
        <span aria-hidden="true">&times;</span>
    </button>
</div>

关闭警告效果:

图片.png
点击(x)可以关闭