# Randomizing CSS based on Array value

**URL:** <https://forum.kirupa.com/t/randomizing-css-based-on-array-value/123136>\
**Category:** Uncategorized\
**Created:** [September 20, 2004, 9:50pm UTC](https://forum.kirupa.com/t/randomizing-css-based-on-array-value/123136 "2004-09-20T21:50:47Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pneumonic](https://avatars.discourse-cdn.com/v4/letter/p/aeb1de/32.png) [@Pneumonic](https://forum.kirupa.com/u/Pneumonic)\
**Post date:** [September 20, 2004, 9:50pm UTC](https://forum.kirupa.com/t/randomizing-css-based-on-array-value/123136/1 "2004-09-20T21:50:47Z")

</div>

So I figured that the last idea I had would not work, but I realized that if I attached each seperate background image from an array to a css element that, that would indeed work.

The problem is I’m not sure how I can attach them. Any help would be appreciated.
