Title: Referencing PHP in CSS
Last modified: August 31, 2016

---

# Referencing PHP in CSS

 *  [revendel](https://wordpress.org/support/users/revendel/)
 * (@revendel)
 * [10 years, 1 month ago](https://wordpress.org/support/topic/referencing-php-in-css/)
 * I have a simple problem on a website I’m working on, I want to dynamically get
   featured image, which I know how to do.
 * But the background image for the div which holds it is defined in the CSS. This
   is mandatory as I need a gradient overlay over the image which can be done in
   CSS.
 * I was thinking of assigning the div an image in the HTML and set the gradient
   overlay in the CSS and give it a z-index of whatever.
 * How do you dynamically reference post images if you have additional formatting?
   Much appreciated.
 * The site i am working on is [here](http://saptarshimasid.com/mhealth/).

The topic ‘Referencing PHP in CSS’ is closed to new replies.

## Tags

 * [Dynamic images](https://wordpress.org/support/topic-tag/dynamic-images/)

 * 0 replies
 * 1 participant
 * Last reply from: [revendel](https://wordpress.org/support/users/revendel/)
 * Last activity: [10 years, 1 month ago](https://wordpress.org/support/topic/referencing-php-in-css/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
