CSS Multiple background images
-
I want to place two background images on my blog theme’s main page.
According to the w3 orgs’s specifications (https://www.w3.org/TR/css3-background/#layering) you can do that by using the ‘background-position’ property, and using ‘multiple comma-separated values.’ They give various examples of the syntax, including this:
body { background-image: url(“marble.svg”) }
p { background-image: none }
div { background-image: url(tl.png), url(tr.png) }and this:
background-image: url(flower.png), url(ball.png), url(grass1.png);
background-position: center center, 20% 80%, top left;
background-origin: border, content, border;
background-repeat: repeat-x, repeat-y, repeat-y, repeat-x, repeat-y;but when I try to use the code in my style sheet like this:
body {
background-image: url(‘images/deco-bar.jpg’), url(‘images/jukebox.gif’);
}It doesn’t work. No images show, neither one. The background-image works ok with a single image, but not with two.
Adding ‘background-position’ and ‘background-repeat’ etc, makes no difference.
Any suggestion why this isn’t working?
- The topic ‘CSS Multiple background images’ is closed to new replies.