使iframe像图像一样

时间:2016-06-20 04:35:18

标签: html css iframe

我想让iframe使用像图像一样,所以它占用了整个背景而不是交互式的。它也不得与我当前的代码冲突:

<!DOCTYPE html>
<html>
<head>
<style>
iframe {
    -webkit-filter: blur(5px);
    filter: blur(5px);
}
</style>
</head>
<body>

<iframe src="http://www.google.com" width="300" height="300"></iframe>

</body>
</html>

1 个答案:

答案 0 :(得分:0)

希望这会有所帮助:

&#13;
&#13;
.container {
  width: 300px;
  height: 300px;
  position: relative; 
  border-radius: 45%;
  overflow: hidden;
}

.container iframe {
  z-index: 1;
  pointer-events: none;
}

.container .blur {
  border-radius: 45%;
  z-index: 2;
  width: 100%;
  height: 100%;
  position: absolute;
  background-color: rgba(255, 255, 255, 0.5);
}
&#13;
<div class="container">
  <div class="blur"></div>
  <iframe src="http://gevorg.me/" width="300" height="300" frameborder="0"></iframe>
</div>
&#13;
&#13;
&#13;

相关问题