---
title: "半透明的层上放一个不透明层"
author: "iammonster"
date: "2009-08-19T11:44:06Z"
tags: []
slug: "untitled"
draft: false
lastmod: "2009-08-19T11:45:29Z"
id: 452674
url: "https://jiajun.iteye.com/blog/452674"
---

```
<!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>
```