Description
Position your components anywhere on the screen and retain a glass blurred background in the container. Simple but stunning effect. No matter how much I can't stand Windows Vista,
I have to credit it for the inspiration - credits to the aero theme used in Windows Vista. Note: if using this technique as a background-image for a website, it works best if the
background-image used for the background and the containers is set to fixed. Then the background position does not need changing with the position.
Demo
Box Header - Drag me around and see what I do
Some dummy text goes in here
This the second box
This one has a fixed height and width
CSS
- #background {
- height: 500px;
- border: 1px solid black;
- background: url("bg2.jpg") white top left repeat scroll;
- overflow: hidden;
- position: relative;
- }
-
- .glass_container {
- background: url("bg2-blurred.jpg") white -20px -20px repeat scroll;
- top: 20px;
- left: 20px;
- width: auto;
- height: auto;
- float: left;
- clear: both;
- position: absolute;
- padding: 20px;
- border-top: 1px solid white;
- border-left: 1px solid #CCCCCC;
- border-right: 1px solid #00B9B9;
- border-bottom: 1px solid #009797;
- color: black;
- cursor: move;
- opacity: 0.9; /*CSS 3*/
- }
-
- #box2 {
- background-position: -390px -100px;
- left: 390px;
- top: 100px;
- width: 300px;
- height: 300px;
- }
XHTML
- <div id="background">
- <div class="glass_container">
- <div title="Click and hold me to drag the window" class="draw_bar"></div>
- <h1>Box Header - Drag me around and see what I do</h1>
- <p>
- Some dummy text goes in here
- </p>
- </div>
-
- <div id="box2" class="glass_container">
- <div title="Click and hold me to drag the window" class="draw_bar"></div>
- <h1>This the second box</h1>
- <p>
- This one has a fixed height and width
- </p>
- </div>
- </div>