파운데이션 알림 상자


Foundation은 알림 상자를 쉽게 생성할 수 있습니다:

알림 상자는 .alert-box 클래스를 사용하여 생성할 수 있으며 선택적 클래스를 추가할 수 있습니다: .secondary , .success, .info, .warning 또는 .alert:.alert-box 类创建, 可以添加可选的类: .secondary, .success, .info, .warning.alert:

实例

<!DOCTYPE html>
<html>
<head>
  <title>Foundation 实例</title>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="stylesheet" href="http://static.php.cn/assets/foundation-5.5.3/foundation.min.css">
  <script src="http://static.php.cn/assets/jquery/2.0.3/jquery.min.js"></script>
  <script src="http://static.php.cn/assets/foundation-5.5.3/js/foundation.min.js"></script>
  <script src="http://static.php.cn/assets/foundation-5.5.3/js/vendor/modernizr.js"></script>
</head>
<body>

<div style="padding:20px;">
  <h2>提醒框</h2>
  <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>
</div>

</body>
</html>

运行实例 »

点击 "运行实例" 按钮查看在线实例


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

圆角提醒框

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

实例

<!DOCTYPE html>
<html>
<head>
  <title>Foundation 实例</title>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="stylesheet" href="http://static.php.cn/assets/foundation-5.5.3/foundation.min.css">
  <script src="http://static.php.cn/assets/jquery/2.0.3/jquery.min.js"></script>
  <script src="http://static.php.cn/assets/foundation-5.5.3/js/foundation.min.js"></script>
  <script src="http://static.php.cn/assets/foundation-5.5.3/js/vendor/modernizr.js"></script>
</head>
<body>

<div style="padding:20px;">
  <h2>圆角提醒框</h2>
  <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>
</div>

</body>
</html>

运行实例 »

点击 "运行实例" 按钮查看在线实例


关闭提醒框

要关闭提醒框,可以在连接或按钮元素上添加 class="close"

Instance

<!DOCTYPE html>
<html>
<head>
  <title>Foundation 实例</title>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="stylesheet" href="http://static.php.cn/assets/foundation-5.5.3/foundation.min.css">
  <script src="http://static.php.cn/assets/jquery/2.0.3/jquery.min.js"></script>
  <script src="http://static.php.cn/assets/foundation-5.5.3/js/foundation.min.js"></script>
  <script src="http://static.php.cn/assets/foundation-5.5.3/js/vendor/modernizr.js"></script>
</head>
<body>

<div style="padding:20px;">
  <h2>关闭提醒框</h2>
  <div data-alert class="alert-box">
    This is a default alert box.
    <a href="#" class="close">×</a>
  </div>

  <div data-alert class="alert-box secondary">
    This is a secondary alert box.
    <a href="#" class="close">×</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">×</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">×</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">×</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">×</a>
  </div>
</div>

<script>
// 创始化 Foundation JS 
$(document).ready(function() {
    $(document).foundation();
})
</script>

</body>
</html>

인스턴스 실행»
온라인 인스턴스를 보려면 "인스턴스 실행" 버튼을 클릭하세요

Note경고 상자 너비는 컨테이너의 100%입니다.

둥근 ​​모서리 알림 상자🎜🎜.radius.round 클래스는 알림 상자에 둥근 모서리를 추가하는 데 사용됩니다. 🎜🎜 🎜인스턴스 🎜🎜rrreee🎜🎜🎜인스턴스 실행»🎜🎜온라인 인스턴스를 보려면 "인스턴스 실행" 버튼을 클릭하세요.🎜🎜

알림 상자 닫기🎜🎜알림 상자를 닫으려면 < code> 또는 버튼 요소 class="close" 클래스를 선택하고 Foundation JS를 초기화합니다. 🎜🎜🎜🎜 인스턴스🎜🎜rrreee🎜🎜🎜인스턴스 실행»🎜🎜"인스턴스 실행" 버튼을 클릭하여 확인하세요. 온라인 인스턴스🎜🎜🎜🎜🎜🎜🎜🎜🎜 × (×)는 문자 "x"가 아닌 닫기 버튼 아이콘을 나타내는 HTML 문자 엔터티입니다. 🎜🎜🎜🎜