I am trying to have a blurred background for my content.
So far I tried this:
.background-image {
background-image: url('../img/background/image.jpg');
width: 100vw;
height: 100vh;
-webkit-filter: blur(10px);
-moz-filter: blur(10px);
-o-filter: blur(10px);
-ms-filter: blur(10px);
filter: blur(10px);
}
and then
<ion-view class="background-image">
// header, content, footer etc
<ion-view>
But then I get the problem that the whole screen is blurred and not only the background as follows:
I am trying to have a blurred background for my content.
So far I tried this:
.background-image {
background-image: url('../img/background/image.jpg');
width: 100vw;
height: 100vh;
-webkit-filter: blur(10px);
-moz-filter: blur(10px);
-o-filter: blur(10px);
-ms-filter: blur(10px);
filter: blur(10px);
}
and then
<ion-view class="background-image">
// header, content, footer etc
<ion-view>
But then I get the problem that the whole screen is blurred and not only the background as follows:
Share Improve this question asked Jun 25, 2015 at 13:30 WJAWJA 7,00420 gold badges95 silver badges169 bronze badges 2 |3 Answers
Reset to default 7put content out side the blurred div.
.background-image {
background-image: url('../img/background/image.jpg');
width: 100vw;
height: 100vh;
-webkit-filter: blur(10px);
-moz-filter: blur(10px);
-o-filter: blur(10px);
-ms-filter: blur(10px);
filter: blur(10px);
}
<div class="background-image"></div>
<div>Content</div>
there is an other way come to my head which is add second background-image
,
which in css3 you can have multi background
for one element, and the second one can be a blur image, even with low quality , like this
in sass
#element
background:
image: url(/*first url*/), url(/*second url*/)
size: auto auto /*first one*/, 100% 100% /* second one*/
i guess second will cover first or revers , you can try it out
Put the image outside the other div... Like this:
<div class="background-image"></div>
<div class="content">
<p>Here goes your content</p>
</div>
<ion-view class="background-image"></ion-view> <div>header, content, footer</div>
– blex Commented Jun 25, 2015 at 13:32