Note that there are some explanatory texts on larger screens.

plurals
  1. POwhat's the correct shorthand syntax when using multiple css background images/gradients?
    primarykey
    data
    text
    <p>I need to attach multiple backgrounds to an element via CSS and I can't use <code>:before/:after</code>.</p> <p>I'm wondering what the correct syntax to use multiple CSS background image is.</p> <p>There is a bunch of suggested ways I found, like <a href="http://snook.ca/archives/html_and_css/multiple-bg-css-gradients" rel="nofollow">here</a> or <a href="http://css-tricks.com/stacking-order-of-multiple-backgrounds/" rel="nofollow">here</a>, but I can get neither of these:</p> <pre><code>background: url(…) 0 0 repeat, url(…) 5px 5px no-repeat #FFF; background: url(…) 600px 10px no-repeat, url(…) 10px 10px no-repeat; </code></pre> <p>to work.</p> <p>This is what I currently have:</p> <pre><code>background-image: rgba(0, 0, 0, 0.4) url("img/icons-18-white.png") no-repeat 0% 50%,linear-gradient( #9ad945, #7eb238 ); </code></pre> <p>which is ignored. Only when I supply the pure url, it works:</p> <pre><code>background-image: url("img/icons-18-white.png") , linear-gradient( #9ad945, #7eb238 ); </code></pre> <p><strong>Question:</strong><br> I'm specifically looking for a way to set <code>background-size/position/repeat</code> per image, so if someone could point me to the correct syntax, would be really nice! </p> <p><strong>EDIT</strong>: Adding <code>scroll</code> and replacing <code>background-image</code> with <code>background</code></p> <pre><code>background: rgba(0, 0, 0, 0.4) url("http://code.jquery.com/mobile/1.3.0/images/icons-18-white.png") no-repeat scroll 0% 50%, linear-gradient( #9ad945, #7eb238 ); </code></pre> <p>does not work.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload