I know this question has been asked numerous times, but my questions is kinda different since I have created a box that is blurred. But my question focuses on the background image of the blurred box.
So basically, I have the following blurred box. An I will use it in a plugin. DEMO
In order to make this box blurred, .dany:before
must have the same background as the parents' backgrounds. But since this is the skin of a plugin, I cannot predict what background its parents will have. So I am looking in a way that can find its parent background or backgrounds and set it as the background of the plugin so the blurred effect can work.
I don't mind JavaScript or jQuery but it is really important that it will work in any case.
Any idea how to achieve this?
body,
.dany:before {
background: url(http://hdwallpaperbackgrounds.net/wp-content/uploads/2016/07/background-pictures-2.jpg)
}
.dany {
width: 600px;
height: 200px;
border: 1px solid black;
position: relative;
background: rgba(230, 240, 255, 0.4);
}
.dany:before {
content: '';
position: absolute;
z-index: -1;
height: 100%;
top: 0;
right: 0;
left: 0;
filter: blur(8px);
-webkit-filter: blur(8px);
-moz-filter: blur(8px);
-o-filter: blur(8px);
-ms-filter: blur(8px);
}
<div class="dany">TEXT</div>