<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>JS/CSS 各种操作信息提示效果</title>
<style>
.alert {
padding: 20px;
background-color: #f44336;
color: white;
opacity: 1;
transition: opacity 0.6s;
margin-bottom: 15px;
} .alert.success {background-color: #4CAF50;}
.alert.info {background-color: #2196F3;}
.alert.warning {background-color: #ff9800;} .closebtn {
margin-left: 15px;
color: white;
font-weight: bold;
float: right;
font-size: 22px;
line-height: 20px;
cursor: pointer;
transition: 0.3s;
} .closebtn:hover {
color: black;
}
</style>
</head> <body>
<h2>提示信息</h2>
<p>点击 "x" 关闭提示框。</p>
<div class="alert">
<span class="closebtn">&times;</span>
<strong>危险!</strong> 危险操作提示。
</div> <div class="alert success">
<span class="closebtn">&times;</span>
<strong>成功!</strong> 操作成功提示。
</div> <div class="alert info">
<span class="closebtn">&times;</span>
<strong>提示!</strong> 提示信息修改等。
</div> <div class="alert warning">
<span class="closebtn">&times;</span>
<strong>警告!</strong> 提示当前操作要注意。
</div>
<script>
var close = document.getElementsByClassName("closebtn");
var i; for (i = 0; i < close.length; i++) {
close[i].onclick = function(){
var div = this.parentElement;
div.style.opacity = "0";
setTimeout(function(){ div.style.display = "none"; }, 600);
}
} </script>
</body>
</html>

最新文章

  1. 【原】Learning Spark (Python版) 学习笔记(二)----键值对、数据读取与保存、共享特性
  2. 在用到select2时,临时抱佛脚学习了一下
  3. 还原ORACLE DUMP 的值
  4. Django开发博客- 三部曲
  5. 【算法入门】广度/宽度优先搜索(BFS)
  6. B&#39;day Gift
  7. current imporant Posts
  8. invalid nib registered for identifier (重用符) - nib must contain exactly one top level object which must be a UITableViewCell instance&#39;
  9. Android 检测是否连接蓝牙耳机
  10. C# 之 static的用法详解
  11. 谈谈Nginx-HTTPS加密技术
  12. 在Ubuntu1404的64bit版本下安装caffe
  13. [HTML]html读取本地文件并显示
  14. android--------Socket的简单了解
  15. Liberty Mutual Property Inspection, Winner&#39;s Interview: Qingchen Wang
  16. MongoDB副本集配置系列二:配置MongoDB副本集
  17. axios构建缓存池存储基础数据
  18. Gitlab CI-1.Gitlab部署
  19. 【大数据】Hadoop的高可用HA
  20. vim 折叠的用法

热门文章

  1. Centos7 网络出错(failed to start LSB: Bring up/down networking )
  2. avalon 笔记---Mr.wing
  3. BZOJ 1050 枚举+并查集
  4. 变量对象、作用域链和This
  5. 实现人脸识别性别之路---网页上的video标签
  6. js编码方式详解
  7. 无闻go编程基础笔记
  8. GCJ1C09C - Bribe the Prisoners
  9. Android基础新手教程——1.2.1 使用Eclipse + ADT + SDK开发Android APP
  10. [Python] Find available methods and help in REPL