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.
There's no way to change the background "behind" the image that is set as background, but that is also not what you supposedly want.
The background shorthand also gives you the possibility to set a color value. That would be visible everywhere the background is not covered by the image.
So just use:
you are using background's short hand, you can write it as
background-image :
background-color :
background-size :
background-repeat :
The background shorthand property is made up of eight other properties:
Hence, the shorthand property can be written as :
In your case you would use this (since you want black color) :
See an example below :
Hope this helps!!!
Simply include background color in your declartion