I need to know how to get the background image to not be blurry when text is over it in CSS as it spoils the look of my website if it's blurry.
My CSS is:
background: #ff0000 url(img/rain.jpg) top center repeat-y;
background-size: 100%;
But when I load it up where there is text that line goes blurry and I don't want it to so how do I do this?
You can use
image-rendering: pixelated
. Here is an example from the Mozilla Developer Network:https://developer.mozilla.org/en-US/docs/Web/CSS/image-rendering
https://jsfiddle.net/9dtj2wkq/
Try to add:
image-rendering: -webkit-optimize-contrast;
I got it by doing:
to the
h2
andp
elements.use of
background-size: cover;background-position:50% 50%;
will help you..UPDATED FIDDLE
Here's the cross browser technique:
Try adding this to the code:
image-rendering: pixelated;
For me it worked perfectly. you can also try -image-rendering: -webkit-optimize-contrast;