CSS背景图片

Chr*_*her 0 html css

我有

.green {
background-image:('http://i42.tinypic.com/xzup2.jpg')
background-repeat: no-repeat;
height:430px;
width:100%;
}
.yellow {
background-image: url('/images/yellowlight.png');
background-repeat: no-repeat;
height:430px;
width:100%;
}
Run Code Online (Sandbox Code Playgroud)

在我的CSS.

.yellow工作正常,但是.green.不起作用.怎么了?

Jim*_*dra 6

你错过了"url"位.

background-image:('http://i42.tinypic.com/xzup2.jpg')

应该:

background-image: url('http://i42.tinypic.com/xzup2.jpg');