I'm not exactly sure how to describe this, so I'll do my best.

I have a themes page that I want to recode.

I am using MySQL, in my themes table, each row has the following set of fields...id, name, css, active.

The css field points to the css file to be loaded on the main pages.

I have several rows of themes.

I want to be able to pull things such as the background image, background color, border, etc. from each theme's css file and populate the theme's box(div tag).

The code would look something like this once done...

HTML Code:
<div id="theme_dir">
	<div class="theme_box" style="border:5px solid rgba(0,0,0,1);background-image:url('image.jpg');">
    	<h1 style="font-family:'Trebuchet MS', Arial, Helvetica, sans-serif;font_size:0.8em;font-color:rgba(255,255,255,1);">Theme Name</h1>
    </div>
	<div class="theme_box" style="border:5px solid rgba(0,0,0,1);background-image:url('image.jpg');">
    	<h1 style="font-family:'Trebuchet MS', Arial, Helvetica, sans-serif;font_size:0.8em;font-color:rgba(255,255,255,1);">Theme Name</h1>
    </div>
	<div class="theme_box" style="border:5px solid rgba(0,0,0,1);background-image:url('image.jpg');">
    	<h1 style="font-family:'Trebuchet MS', Arial, Helvetica, sans-serif;font_size:0.8em;font-color:rgba(255,255,255,1);">Theme Name</h1>
    </div>
	<div class="theme_box" style="border:5px solid rgba(0,0,0,1);background-image:url('image.jpg');">
    	<h1 style="font-family:'Trebuchet MS', Arial, Helvetica, sans-serif;font_size:0.8em;font-color:rgba(255,255,255,1);">Theme Name</h1>
    </div>
	<div class="theme_box" style="border:5px solid rgba(0,0,0,1);background-image:url('image.jpg');">
    	<h1 style="font-family:'Trebuchet MS', Arial, Helvetica, sans-serif;font_size:0.8em;font-color:rgba(255,255,255,1);">Theme Name</h1>
    </div>
	<div class="theme_box" style="border:5px solid rgba(0,0,0,1);background-image:url('image.jpg');">
    	<h1 style="font-family:'Trebuchet MS', Arial, Helvetica, sans-serif;font_size:0.8em;font-color:rgba(255,255,255,1);">Theme Name</h1>
    </div>
</div>
of course each one being different...