I'm trying to create an iOS 7 style frosted look with HTML5, CSS3 and JavaScript which can work on webkit browsers.
Technically, given the following HTML:
<style>
#partial-overlay {
width: 100%;
height: 20px;
background: rgba(255, 255, 255, .2); /* TODO frost */
position: fixed;
top: 0;
left: 0;
}
</style>
<div id="main-view">
<div style="width: 50px; height: 50px; background: #f00"></div>
To my left is a red box<br>
Now there is just text<br>
Text that goes on for a few pixels <br>
or even more
</div>
<div id="partial-overlay">
Here is some content
</div>
I'd like to apply something like a -webkit-filter: blur(5px) to the first 20px horizontally of #main-view.
If the CSS was modified to be #partial-overlay { width: 20px; height: 100%; ...} then I'd need to apply the -webkit-filter: blur(5px) to the first 20px vertically.
The obvious solution is to use javascript to make a clone of the #main-view, set overflow: hidden and then change the width/height as appropriate but that seems to me hard to generalize to more complex pages/CSS structures.
Is there a better way to achieve this with minimal performance hit and maximal generalizability?
EDIT: Here is an example of what I'm trying to achieve:


:first-linepseudo element. - cimmanonwebkit-filter: blurdoesn't seem to work withfirst-line, looks like only some styles are allowed for that pseudo class - Subhas