A Pen By simurai

Pen Settings

↑ Insert the most common viewport meta tag

CSS Base

Vendor Prefixing

Add External CSS

These stylesheets will be added in this order and before the code you write in the CSS editor. You can also add another Pen here, and it will pull the CSS from it. Try typing "font" or "ribbon" below.

Quick-add: + add another resource
via CSS Lint

Add External JavaScript

These scripts will run in this order and before the code in the JavaScript editor. You can also link to another Pen here, and it will run the JavaScript from it. Also try typing the name of any popular library.

Quick-add: + add another resource
via JS Hint

Code Indentation


Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Want a Run Button?

If active, the preview will update automatically when you change code.


              <div class="box">
  <h2>iOS 7</h2>
  <p>When you bring up the control center in iOS 7, the background is shown with a translucant effect.</p>
  <img src="http://s.cdpn.io/79/ios7.controlcenter.jpg">
<div class="box">
  <p>Is there a way to do it on the web?</p>
  <div class="iphone">
    <div id="homescreen" class="homescreen">
      <div class="animation"></div>
    <div class="control-center">
      <div class="control-center-background"></div>
      <div class="control-center-content">
        <h3>Control Center</h3>
  <p>It kinda works if the layer underneath would be just a known static background (like in the example above). You could doublicate it and just add a CSS filter. But since it could be anything, you kinda have to take "screenshots" of it. And if there is also animation underneath (like with the Gyro and in the above example the red ball), even more tricky. In Firefox there is the <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/element">element property</a> that could work. But that's still experimental.</p>
  <p>Any other way to "screen record" other HTML elements and use it as a background?</p>
  <p><strong>Update I: </strong><a href="https://twitter.com/SaraSoueidan/status/350479973288648705">Some</a> <a href="https://twitter.com/cgiffard/status/350480271872770048">suggested</a> using CSS shaders.</p>
  <p><strong>Update II: </strong>Here a <a href="http://iamvdo.me/conf/2012/kiwiparty/#/33">demo</a> that uses -moz-element to "screen record" the background (Test with Firefox, click anywhere to bring up the popup). It's getting close. It just needs better browser adoption and better performance.. kinda lags behind when dragging around.</p>


.iphone {
  position: relative;
  width: 244px;
  height: 433px;
  overflow: hidden;

.homescreen {
  width: inherit;
  height: inherit;
  background: url(http://s.cdpn.io/79/ios7-homescreen.jpg);
  background-size: 100%;

.animation {
  margin: 0 auto;
  width: 50px;
  height: 50px;
  background: red;
  border-radius: 25px;
  animation: animate 1s alternate infinite;

@keyframes animate {
  100% { transform: translateY(200px); }

.control-center {
  position: absolute;
  background: hsla(0,0%,100%,.8);
  top: 112px;
  left: 0;
  right: 0;
  bottom: 0;

.control-center:hover .control-center-background {
  background: transparent;

.control-center-background {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: url(http://s.cdpn.io/79/ios7-homescreen.jpg);
  background-size: 100%;
  background-position: center bottom;
  -webkit-filter: contrast(30%) brightness(160%) blur(12px);

.control-center-content {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  text-align: center;

h3 {
  line-height: 3em;
  font-weight: normal;
  border-bottom: 1px solid black;

.box {
  display: inline-block;
  padding: 30px;
  width: 45%;
  min-width: 244px;
  vertical-align: top;

* {
  box-sizing: border-box;


Loading ..................