博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

CSS: 在半透明的层上放一个不透明层

Posted on 2007-11-16 13:37  Snapping  阅读(1190)  评论(0编辑  收藏  举报

<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=utf-8">
  <title> new document </title>
  <meta name="generator" content="editplus">
  <meta name="keywords" content="">
  <meta name="description" content="">
  <style type="text/css">
   #div1 {
    position: absolute;
    background-color: #ccc;
    width: 100px;
    height: 100px;
    left: 100px;
    top: 100px;
    filter:alpha(opacity=60);
    -moz-opacity: 0.60;
    opacity: 0.60;
   }

   #div2 {
    position: absolute;
    background-color: #99FF99;
    width: 100px;
    height: 100px;
    left: 150px;
    top: 150px;
   }
  </style>
 </head>

 <body>
  <iframe src="http://google.com" width="400" height="300"></iframe>
  <div id="div1">
   半透明
  </div>
  <div id="div2">
   不透明
   <button>不透明,不是吗?</button>
  </div>
 </body>
</html>