Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <head>
- <title>Blurred DIVs</title>
- <style type="text/css">
- .wrap {
- max-width: 1080px;
- height: auto;
- }
- #bg, #search-bg {
- background-image: url('http://jordanhollinger.com/media/freelancer-desk.jpg');
- background-repeat: no-repeat;
- background-size: 1080px auto;
- }
- #bg {
- background-position: center top;
- padding: 70px 90px 120px 90px;
- }
- #search-container {
- position: relative;
- }
- #search-bg {
- /* Absolutely position it, but stretch it to all four corners, then put it just behind #search's z-index */
- position: absolute;
- top: 0px;
- right: 0px;
- bottom: 0px;
- left: 0px;
- z-index: 99;
- /* Pull the background 70px higher to the same place as #bg's */
- background-position: center -70px;
- filter: blur(10px);
- -webkit-filter: blur(10px);
- -moz-filter: blur(10px);
- filter: url('/media/blur.svg#blur'); /* for Firefox */
- }
- #search {
- /* Put this on top of the blurred layer */
- position: relative;
- z-index: 100;
- padding: 20px;
- background: rgb(34,34,34); /* for IE */
- background: rgba(34,34,34,0.75);
- }
- @media (max-width: 600px ) {
- #bg { padding: 10px; }
- #search-bg { background-position: center -10px; }
- }
- #search h2, #search h5, #search h5 a { text-align: center; color: #fefefe; font-weight: normal; }
- #search h2 { margin-bottom: 50px }
- #search h5 { margin-top: 70px }
- </style>
- </head>
- <body>
- <div class="wrap">
- <div id="bg">
- <div id="search-container">
- <div id="search-bg"></div>
- <div id="search">
- <h2>Awesome freelancers at the right price</h2>
- <h5><a href="#">How it works »</a></h5>
- </div>
- </div>
- </div>
- </div>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment