Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/image/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Css 如何防止背景图像变得模糊_Css_Image_Background_Blurry - Fatal编程技术网

Css 如何防止背景图像变得模糊

Css 如何防止背景图像变得模糊,css,image,background,blurry,Css,Image,Background,Blurry,我需要知道如何使背景图像不模糊时,文本是在它的CSS,因为它破坏了我的网站,如果它是模糊的外观 我的CSS是: background: #ff0000 url(img/rain.jpg) top center repeat-y; background-size: 100%; 但当我把它加载到有文字的地方,那行文字会变得模糊,我不想让它模糊,那么我该怎么做呢 使用背景尺寸:封面;背景位置:50%50%将帮助您 * { font-family: Calibri, Comic Sans MS,

我需要知道如何使背景图像不模糊时,文本是在它的CSS,因为它破坏了我的网站,如果它是模糊的外观

我的CSS是:

background: #ff0000 url(img/rain.jpg) top center repeat-y; 
background-size: 100%; 
但当我把它加载到有文字的地方,那行文字会变得模糊,我不想让它模糊,那么我该怎么做呢


使用
背景尺寸:封面;背景位置:50%50%将帮助您

* {
font-family: Calibri, Comic Sans MS, Serif;
background: #ff0000 url(http://www.coolguysite.co.uk/blog/templates/default/img/rain.jpg)   top center repeat-y;
background-size: cover;
background-position:50% 50%;
}

我是通过以下方式获得的:

background: transparent;
添加到
h2
p
元素。

尝试添加:

image-rendering: -webkit-optimize-contrast;

尝试将此添加到代码:
图像渲染:像素化对我来说,它工作得非常好。

您还可以尝试-
图像渲染:-webkit优化对比度

以下是跨浏览器技术:

 image-rendering: crisp-edges;
 image-rendering: -moz-crisp-edges;          /* Firefox */
 image-rendering: -o-crisp-edges;            /* Opera */
 image-rendering: -webkit-optimize-contrast; /* Webkit (non-standard naming)*/
 -ms-interpolation-mode: nearest-neighbor;   /* IE (non-standard property) */

您可以使用
图像渲染:像素化
。以下是来自Mozilla开发者网络的一个示例:

.pixelated {
  image-rendering: pixelated;
  -ms-interpolation-mode: nearest-neighbor;
}


哇。我很惊讶。你在这个问题上完全没有背景。在不了解上下文的情况下,这只是无法回答的垃圾。请添加代码、屏幕截图、URL,或者至少是一些专门描述问题、导致问题的原因、以及您所处的位置的内容。。。您可能还想阅读,这可能对我们大家都有利。我的代码是:background:#ff0000 url(img/rain.jpg)top-center repeat-y;背景大小:100%;但是当我在有文本的地方加载它时,行会变得模糊,我不想让它模糊,那么我该怎么做呢?把有问题的代码放到注释中,如果可能的话,给我们一个jsfiddle.netOk的实例谢谢,我以为jsfiddle只是为了JavaScript@JoshKeighley你粘贴的代码很好。但遗憾的是,这并不相关。相关的事情是看看文本部分是什么。你所说的模糊是指“文本下变灰”吗?可能是你有一个背景不完全透明的div,但可以说只有50%。你可以很容易地看到发生了什么,也可以使用诸如Firebug中的CSS工具之类的工具来纠正它……他们应该在浏览器中内置此功能。为什么有人希望他们的图像模糊。如果你用这个答案缩小图像,Duhit看起来会很糟糕透明背景如何防止背景图像变得模糊。。。