更改图像CSS后面的背景颜色 [英] Changing the colour of background behind image css

查看:98
本文介绍了更改图像CSS后面的背景颜色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在CSS中,我使用gif作为背景图片:

In CSS I'm using a gif as a background image:

background: url(http://*URL of gif*) no-repeat 50% 50%;

但是根据屏幕大小,我仍然可以稍微看到该图像后面的背景(白色).如何更改该图像后面的颜色?我想将其更改为黑色.

but depending on screen size I can still slightly see the background behind that image(it is white). How do I change the colour behind that image? I want to change it to be black.

推荐答案

在声明中仅包含背景色

background: yourcolor url(http://*URL of gif*) no-repeat 50% 50%;

这篇关于更改图像CSS后面的背景颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆