CSS实现的loading页面等待效果

来源:互联网 发布:淘宝交保证金怎么交30 编辑:程序博客网 时间:2024/05/17 15:38

有些页面加载起来比较慢,为了加强用户体验效果,所以一般都会做一个页面加载等待的提示,页面加载完成后消失。下面是用CSS实现的一个简单的页面加载等待效果,大家可以参考:

[html] view plaincopy
  1. <span style="font-size:18px;"><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">  
  2. <html>  
  3. <head>  
  4. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">  
  5. <title>无标题文档</title>  
  6. <style type="text/css">  
  7. .loading{  
  8.     width:160px;  
  9.     height:56px;  
  10.     position: absolute;  
  11.     top:50%;  
  12.     left:50%;  
  13.     line-height:56px;  
  14.     color:#fff;  
  15.     padding-left:60px;  
  16.     font-size:15px;  
  17.     background: #000 url(images/loader.gif) no-repeat 10px 50%;  
  18.     opacity: 0.7;  
  19.     z-index:9999;  
  20.     -moz-border-radius:20px;  
  21.     -webkit-border-radius:20px;  
  22.     border-radius:20px;  
  23.     filter:progid:DXImageTransform.Microsoft.Alpha(opacity=70);  
  24. }  
  25. </style>  
  26. </head>  
  27.   
  28. <body>  
  29. <div id="loading" class="loading">Loading pages...</div>  
  30. </body>  
  31. </html></span>  

css中的图片在下面:


整个效果图如下:


0 0
原创粉丝点击