background-image
设置元素的背景图片
none(默认值)url链接gradient渐变
none
background-image默认值为none,即不显示图片
url
background-image可以通过url引入图片
gradient
线性渐变
镜像渐变
重复渐变
图片超过元素宽高怎么办?
图片超过元素宽高,超过的不显示
background-image可以设置多个图片吗?
像这样设置:
答:可以,先书写的在上面,后写的在下面,但是注意
background-repeat要设置为no-repeat,否则先写的图片会遮挡住图片,- 多个值中不要出现
none,否则background-image会失效,如下:
同时设置background-color和background-image会怎样?
答:如果同时设置background-color和background-image,background-image会遮挡background-color