Reputation: 1
Good day! I don´t know if it´s even possible, but I´m looking for a way to place two or more background-images underneath each other in one div. The images should resize automagically with the "background-size: contain;" tag. Is there a way to do this? I´ve already tried the following:
background-image: url('../img/bild.jpg'), url('../img/bild2.jpg');
background-size: contain contain;
background-repeat: no-repeat, no-repeat;
But it didn´t worked...
Greets, Johnny
Upvotes: 0
Views: 50
Reputation: 2121
hi even you can try this same result using the shorthand method that the only use of background property
you can try this
background: url('../img/bild.jpg'), url('../img/bild2.jpg') no-repeat / contain;
Upvotes: 0
Reputation: 2900
you are missing ,
between contain
background-image: url('../img/bild.jpg'), url('../img/bild2.jpg');
background-size: contain, contain;
background-repeat: no-repeat, no-repeat;
http://www.w3schools.com/css/css3_backgrounds.asp
you can set any set of values for multiple background each separated by ,
. But values for one background are separated by whitespace. Example: difference can be seen in position:
background-position: ??px ??px, ??px ??px;
^^^^ ^^^^ ^^^^ ^^^^
position for: image 1 image 2
Upvotes: 1