Random CSS background image

前端 未结 6 860
囚心锁ツ
囚心锁ツ 2021-01-26 10:19

I can\'t find anything that works for me, and since I\'m a cut and paste html editor (I know only the main basic stuff), I don\'t understand most of the other posts. This is the

6条回答
  •  攒了一身酷
    2021-01-26 10:55

    The issue you're having is that you're trying to define the image inside of the stylesheet. In order to create a random background image, it will have to be attached as an inline style.

    Keep the css how you currently have it for a fallback. You would then have the div look something like this:

    
    

    @Steve-Sanders comment is also correct in that you will need an actual server to run PHP.

提交回复
热议问题