Foundation 提醒框

前言

  • Foundation 提醒框。

1、提醒框

  • 提醒框可以使用 .alert-box 类创建, 可以添加可选的类:.secondary, .success, .info, .warning.alert:

  • 提醒框的宽度为容器的 100%。

  • 实例

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    <div data-alert class="alert-box">
    This is a default alert box.
    </div>

    <div data-alert class="alert-box secondary">
    This is a secondary alert box.
    </div>

    <div data-alert class="alert-box success">
    <strong>Success!</strong> This alert box indicates a successful or positive action.
    </div>

    <div data-alert class="alert-box info">
    <strong>Info!</strong> This alert box indicates a neutral informative change or action.
    </div>

    <div data-alert class="alert-box warning">
    <strong>Warning!</strong> This alert box indicates a warning that might need attention.
    </div>

    <div data-alert class="alert-box alert">
    <strong>Alert!</strong> This alert box indicates a dangerous or potentially negative action.
    </div>
  • 效果 🔗

2、圆角提醒框

  • .radius.round 类用于为提醒框添加圆角:

  • 实例

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    <div data-alert class="alert-box">
    Default Alert box
    </div>

    <div data-alert class="alert-box radius">
    Default Alert box with a radius.
    </div>

    <div data-alert class="alert-box secondary radius">
    Secondy Alert box with a radius.
    </div>

    <div data-alert class="alert-box success radius">
    <strong>Success!</strong> Alert box with a radius.
    </div>

    <div data-alert class="alert-box info round">
    <strong>Info!</strong> Alert box that is rounded.
    </div>

    <div data-alert class="alert-box warning round">
    <strong>Warning!</strong> Alert box that is rounded.
    </div>

    <div data-alert class="alert-box alert round">
    <strong>Alert!</strong> Alert box that is rounded.
    </div>
  • 效果 🔗

3、关闭提醒框

  • 要关闭提醒框,可以在连接或按钮元素上添加 class="close" 类,并初始化 Foundation JS:

  • &times; (×) 是一个 HTML 字符实体表示一个关闭按钮的图标,而不是字母 “x”。

  • 实例

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    <div data-alert class="alert-box">
    This is a default alert box.
    <a href="#" class="close">&times;</a>
    </div>

    <div data-alert class="alert-box secondary">
    This is a secondary alert box.
    <a href="#" class="close">&times;</a>
    </div>

    <div data-alert class="alert-box success">
    <strong>Success!</strong> This alert box indicates a successful or positive action.
    <a href="#" class="close">&times;</a>
    </div>

    <div data-alert class="alert-box info">
    <strong>Info!</strong> This alert box indicates a neutral informative change or action.
    <a href="#" class="close">&times;</a>
    </div>

    <div data-alert class="alert-box warning">
    <strong>Warning!</strong> This alert box indicates a warning that might need attention.
    <a href="#" class="close">&times;</a>
    </div>

    <div data-alert class="alert-box alert">
    <strong>Alert!</strong> This alert box indicates a dangerous or potentially negative action.
    <a href="#" class="close">&times;</a>
    </div>

    <!-- 创始化 Foundation JS -->
    <script>
    $(document).ready(function () {
    $(document).foundation();
    })
    </script>
  • 效果 🔗

文章目录
  1. 1. 前言
  2. 2. 1、提醒框
  3. 3. 2、圆角提醒框
  4. 4. 3、关闭提醒框
隐藏目录