Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/36.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 3背景大小不适用于IE9_Css - Fatal编程技术网

CSS 3背景大小不适用于IE9

CSS 3背景大小不适用于IE9,css,Css,背景图片:url(yellow.jpg); 背景尺寸:180px 180px; 背景重复:无重复 上面提到的css在chrome上运行得非常完美,但是ie9无法正确缩放图像和显示图像你确定你的IE在ie9模式下运行吗?你的代码适用于我尝试的任何图像 (F12打开开发者窗口)我认为问题在于将图像缩放到合适的大小。你试过这个吗 background:url(yellow.jpg) 0 0 / 180px 180px no-repeat fixed; 基本上它的作用是: 背景:背景图像背景位置(顶部

背景图片:url(yellow.jpg);
背景尺寸:180px 180px;
背景重复:无重复


上面提到的css在chrome上运行得非常完美,但是ie9无法正确缩放图像和显示图像

你确定你的IE在ie9模式下运行吗?你的代码适用于我尝试的任何图像


(F12打开开发者窗口)

我认为问题在于将图像缩放到合适的大小。你试过这个吗

background:url(yellow.jpg) 0 0 / 180px 180px no-repeat fixed;
基本上它的作用是:

背景:背景图像背景位置(顶部)背景位置(左侧)/背景大小(高度)背景大小(宽度)背景重复背景附件


这应该适用于IE9(以及所有其他现代浏览器).

IE将在“怪癖”模式下打开一个没有doctype标签的页面,在该模式下背景大小不起任何作用。要强制IE以IE9模式打开页面,请在每个html文档的顶部添加。

Gah。好发现。我花的时间比我愿意承认的要长。