Upload random image in background-image using css

0

Is it possible just using css , loading random images into the background-image property of any element?

For example I have a section

<section id="slide">

</section>

And I have a folder called img that contains 5 files

background-1-img.png
background-2-img.png
background-3-img.png
background-4-img.png
background-5-img.png

Each time the page containing this section is loaded, one of the images in that directory should be set in the section's background-image property in a random way.

My question is, can I just do this with CSS, or will I need the JavaScript for this?

    
asked by anonymous 10.07.2017 / 16:05

0 answers