Title: Dynamic CSS selection
Last modified: August 18, 2016

---

# Dynamic CSS selection

 *  [eduo](https://wordpress.org/support/users/eduo/)
 * (@eduo)
 * [20 years, 6 months ago](https://wordpress.org/support/topic/dynamic-css-selection/)
 * Hello
 * I’ve been dabbing with random and customised settings for my blog (which I use
   mainly for testing things out) and after putting a random Header JPG graphic 
   I decided I didn’t like the default color scheme when shown with half the pictures
   I put there.
 * I was looking around for the best way to set-up a dynamic CSS chooser for when
   a picture is chosen. Currently a PHP script chooses the random picture for the
   header and modifies the header div style information, so the variable is there.
   Theoretically I could pick a CSS based on that variable that contained the correct
   color scheme for the chosen picture (only the color scheme would change, not 
   the layout or anything).
 * Can you guys give some ideas on the best way to do this? I’d like to be able 
   to pick a random image and a CSS to match it (I’d probably just select a number
   at random and have the template pick $var.jpg and $var.css but I wanted to know
   alternatives).
 * Also, has anyone investigated on creating dynamic CSS stylesheets instead of 
   doing fixed ones? I’d rather create a template CSS file and have the variables
   in it changed than creating 30 different CSS files.

The topic ‘Dynamic CSS selection’ is closed to new replies.

## Tags

 * [php](https://wordpress.org/support/topic-tag/php/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 0 replies
 * 1 participant
 * Last reply from: [eduo](https://wordpress.org/support/users/eduo/)
 * Last activity: [20 years, 6 months ago](https://wordpress.org/support/topic/dynamic-css-selection/)
 * Status: not a support question

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
