html - How properly set background opacity in one line in style of body? -
how set background opacity next:
<body style="background-image: url(images/background.jpg); background-color: white; background-position: center center; background-size: 100%; background-repeat: no-repeat">
i try with:
background-opacity: 0.5;
but fail.
it should like:
background-image: url(images/background.jpg) opacity: 0.5;
even,
opacity: .4;
doesn't affect on image, affect on text , whole of body.
solutions div doesn't accepted.
my web page: http://shell.bshellz.net/~panzerdivision/
browsers: firefox & chrome
using opacity
property, changes opacity of element itself.
to have transparent background-color
use rgba()
background color instead:
background-color: rgba(255, 255, 255, .5);
or in short-hand:
background: rgba(255, 255, 255, .5) url(path/to/transparent/background.png) center center no-repeat;
but if need have transparent background image, image should transparent itself.
by way, here solution give opacity background-image
i'm not sure whether or not useful in case.
Comments
Post a Comment