Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to prevent the background image from getting blurry

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?

Fiddle example

like image 704
Josh Keighley Avatar asked Sep 07 '13 21:09

Josh Keighley


People also ask

How do you make a picture background not blurry?

From the drop-down menu beneath the image selection options, change the settings and examine your desktop as they are applied: often, a blurry wallpaper is the result of the menu being set to "Fit" or "Stretch," and adjusting it to "Fill" or "Center" can solve the problem immediately.

Why are my background photos blurry?

This can happen if the picture file does not match the size of your screen. For example, many home computer monitors are set at a size of 1280x1024 pixels (the number of dots that make up the image). If you use a picture file smaller than this, it will be blurry when it is stretched out to fit the screen.

How do I make a background image not blurry in HTML?

use of background-size: cover;background-position:50% 50%; will help you..


2 Answers

Try to add:

image-rendering: -webkit-optimize-contrast;
like image 190
Kirill A Avatar answered Nov 15 '22 23:11

Kirill A


Try adding this to the code: image-rendering: pixelated; For me it worked perfectly. you can also try - image-rendering: -webkit-optimize-contrast;

like image 27
Nurealam Sabbir Avatar answered Nov 16 '22 00:11

Nurealam Sabbir