Making my image blurry in certain parts - html

My question is, how to i blur certain parts of my image?
Codepen of project (You can press Change View > Full Page to see the pen like a user would.)
It has a plain white div with background images behind it.
How could I make my .parent have a transparent background and my body have blur background?
Also how could I make the background image fit to screen?
Please comment below to ask for more information if needed.
I'm sorry if there's is already a similar post about this. This is my 2nd post on this website, so I'm sorry if I'm breaking any rules.

CodePen
Also how could I make the background image fit to screen?
Use background-size: cover.
.parent have a transparent background
Just remove the background property. Or use transparent rbga colors .
my body have blur background
Since the image is smaller than the background, this has been achieved naturally.
I used the filter property, which is applied to the entire element though. As a result, you must use an additional HTML element This could be a pseudo element, but I just used a div:
HTML: <div class="background"></div>.
CSS:
.background {
background: url("https://ak6.picdn.net/shutterstock/videos/10908707/thumb/1.jpg");
/* Apply major the blur filter. Change `1em` for more. */
-webkit-filter: blur(1em);
-moz-filter: blur(1em);
-o-filter: blur(1em);
-ms-filter: blur(1em);
filter: blur(1em);
/* Make background not move */
position: fixed;
/* ...and fill more than entire screen. Removes additional white sides from filter. */
top: -1em;
left: -1em;
right: -1em;
bottom: -1em;
/* Make the element appear behind all others */
z-index: -1;
/* Make the background cover the entire element */
background-size: cover;
}

Related

Setting noise GIFs as background

Good day.
I want to set a background with gifs on the site.
The problem is that the gif itself has a white background and therefore the entire site becomes the same white.
Is there some way to eliminate this white background.
The problem is that it overlays on top of everything except the header, which has a z-index of 10. Although I set for a background with noise z-index: -1
html
<div class="noise-bg"></div>
I use a div and size it to the full width of the screen and also give it position: fixed
css
.noise-bg
position: fixed
width: 200%
height: 200%
top: -50%
left: -50%
background: url('../images/general/noise.gif')
background-size: 1.8%
pointer-events: none
z-index: -1
opacity: 16%
GIF
Simply add the class to the html tag:
<html class="noise-bg">
And the CSS something like:
.noise-bg {
background: white url("https://i.stack.imgur.com/dzzC1.gif") left top/1.8% 1.8% repeat;
}
Or style directly the html tag:
html {
background: white url("https://i.stack.imgur.com/dzzC1.gif") left top/1.8% 1.8% repeat;
}

Background-attachment:fixed; not working

I've searched and searched, but I can't, for the life of me, figure out what is wrong with my background attachment. I can't get it to break free from the div. For brevity, here is a fiddle for you to observe and test. I'm working with Skrollr.js which might be a factor FYI.
The second panel that moves up over the first is the one I'm referring to. And by "break free" I mean that the #panel-2 background is traveling with the #panel-2 div to cover the first panel instead of the #panel-2 background being fixed at the top of the viewport and being "revealed" by the #panel-2 div moving into the viewport.
<div id="panel-2" class="panel" data-0="transform:translate3d(0%,100%,0)" data-200p="transform:translate3d(0%,0%,0)"></div>
#panel-2 {
background: url('http://dev.synergexis.com/skp/example-img/panel-2-bg.jpg') no-repeat center center;
background-size: cover;
background-attachment:fixed;
transform:translateZ(0%, 100%, 0);
-ms-transform:translateZ(0%, 100%, 0);
/* IE */
-moz-transform:translateZ(0%, 100%, 0);
/* Firefox */
-webkit-transform:translate3d(0%, 100%, 0);
/* Safari Chrome */
-o-transform:translateZ(0%, 100%, 0);
/* Opera */
z-index:-2;
}
Here is an example of the behavior. Given by the amazing, I Hate Tomatoes', Petr Tichy... the second section right below the header with the red and blue stars and dots is the effect I would like to mimic.
Try to avoid using css 3dtranslations, the working skrollr demo you are trying to mimic doesn't use them. I have read some complaints about css 3dtranslations ignoring fixing content to viewport before. Once you remove them, the background-attachment should start working.

CSS textbox- overlay a background over another background

I have a textbox that is formatted through a background-image. Now, when some AJAX processing is happening, I want to display a spinning icon in the bottom right of the textbox. I can add the class to the text box when this happens, but it obviously replaces the background.
.suburb-loading {
background: url('/images/loading_spinner.gif') right center no-repeat;
}
Is their a way to overlay 2 backgrounds? Or what is the best way here to overlay the image over the background?
Use CSS multiple backgrounds by just separating them with a comma
.suburb-loading {
background-image: url('1.png'), url('2.png');
background-repeat: no-repeat, no-repeat;
}
Demo
Fiddle CSS
input {
background-image: url('http://www.melabev.org/images/spinner.gif?1331633304'), url('http://1-art.eu/images/backgrounds/vellum/vellum-old-vellum-background2.jpg');
background-repeat: no-repeat, no-repeat;
background-position: center right, 0 0;
height: 35px;
}
You can either make use of CSS3 Multiple Background feature, but you should know that this will not work in all browsers, Or you can create another div overlaying the original one like with absolute position and this will work for old browsers those don't support multiple backgrounds

How can I have a gradient background with a solid colour behind it that extends to the bottom of the page?

I've tried to do this various different ways, but have had no success so far.
Essentially what I want is a gradient going down the page (which I am using a background image for), then once the image ends, I want a background colour to take over (so that the page doesn't just turn white).
I've tried messing around with using different div tags and the like to layer things etc, but have had no luck so far. Either the background colour overrides the image, or the colour doesn't extend to the bottom of the page.
You could just use a background for your body:
body {
/* Your gradient image */
background-image: url(my_gradient.png);
/* Color below the background image */
background-color: #C0FFEE;
/* Only repeat from left to right */
background-repeat: repeat-x;
}
Or use the background shorthand
body {
background:#C0FFEE url('my_gradient.png') repeat-x left top;
}
You probably want to do something like this:
body
{
background: #FFCC00 url('your-background.png') repeat-x;
}
Try something like this:
http://jsfiddle.net/pUKeT/
body{
background: blue url(http://www.laserasecroydon.com/assets/images/blue-gradient.jpg) no-repeat fixed left top;
}
It's not pretty, but this way you can see where the color should take over
body{
background:url("image.jpg") #COLOR no-repeat;
}
Thanks guys, I've worked it out. The CSS I was using was fine, it was the image that was the problem. Instead of setting the background to white, it was transparent. Hence the colour came through and overrode the gradient. I've now set the background to white, and it works fine.

How to stretch background image of a table cell with CSS?

How can I stretch background image of a table cell with CSS? I have Googled it with no results.
When you set background image of a cell and the background size is smaller than the cell, then it will be repeated.
How can I force this background to stretch the entire table cell instead?
It is possible to stretch a background image using the background-size CSS property.
Examples:
body { background-size: 100% auto } /* Stretches image to full horiz. width */
body { background-size: 50% 50% } /* Stretches image to half of available
width and height - WARNING: aspect ratio not maintained */
body { background-size: cover } /* Ensures that image covers full area */
body { background-size: contain } /* Ensures that image is completely visible */
All major current browsers support the feature:
IE since 9.0
Chrome since 3.0
Firefox since 4.0
Opera since 10.0
Safari since 4.1
You can't stretch a background image.
If you want to stretch an image, you have to put it in an img tag. You can use absolute positioning to put content on top of the image.
It is possible.
NOTE: This is using CSS3 and will not be supported by inferior browsers.
If you set your cell with this styling it should solve your problem. It will also allow for collapsible tables too because you're using %.
background-image: url('XXX');
background-repeat: no-repeat;
background-size: 100% 100%;