Title: Inline CSS and Background Images
Last modified: May 29, 2020

---

# Inline CSS and Background Images

 *  Resolved [NicheLabs](https://wordpress.org/support/users/allennichelabs/)
 * (@allennichelabs)
 * [6 years ago](https://wordpress.org/support/topic/inline-css-and-background-images/)
 * Under Advanced Asset Optimization, if I mark my theme’s CSS file to be inline
   I lose all my background images since the CSS file calls the images using relative
   directories (ie. images/background_image.jpg) rather than absolute directories(
   [https://website.com/wp-content/theme/mytheme/images/background_image.jpg](https://website.com/wp-content/theme/mytheme/images/background_image.jpg)).
 * Is there a way around this or do I need to edit my theme’s CSS file? I would 
   rather not make that change since it requires making a child theme so I don’t
   lose these changes when the theme is updated.

Viewing 4 replies - 1 through 4 (of 4 total)

 *  Plugin Support [Saurabh – WPMU DEV Support](https://wordpress.org/support/users/wpmudev-support7/)
 * (@wpmudev-support7)
 * [6 years ago](https://wordpress.org/support/topic/inline-css-and-background-images/#post-12912659)
 * Hello [@allennichelabs](https://wordpress.org/support/users/allennichelabs/),
 * I went and tested this on my lab site and was not able to replicate it on my 
   lab site with a default theme. I did make some custom additions to replicate 
   the issue by making a theme and assigning background images and them inlining
   those CSS files to check but was not able to replicate the same.
 * Could you tell me which theme are you currently to install the same on my end
   and check this further? Though I’m not sure we would have the theme if that is
   a premium one. Looking forward to hearing from you.
 * Regards,
    Prathamesh Palve
 *  Thread Starter [NicheLabs](https://wordpress.org/support/users/allennichelabs/)
 * (@allennichelabs)
 * [6 years ago](https://wordpress.org/support/topic/inline-css-and-background-images/#post-12928835)
 * It’s a custom theme that was developed inhouse. Strange that you cannot replicate
   it. The css file uses background: url(images/background_image.jpg); When I set
   it to make the CSS inline and I look at the site, the background image doesn’t
   display and when I look at the source it shows the CSS as background: url(images/
   background_image.jpg), so it’s looking for the image from the home directory 
   rather than the template directory.
 *  Plugin Support [Dimitris – WPMU DEV Support](https://wordpress.org/support/users/wpmudev-support6/)
 * (@wpmudev-support6)
 * [6 years ago](https://wordpress.org/support/topic/inline-css-and-background-images/#post-12948340)
 * Hello [@allennichelabs](https://wordpress.org/support/users/allennichelabs/)
 * Could you please send me an email to [contact@wpmudev.org](https://wordpress.org/support/topic/inline-css-and-background-images/contact@wpmudev.org?output_format=md)
   using this template:
 * > Subject: “**Attn: Dimitris**”
   >  Message: link back to this thread for reference
 * Keep in mind the subject line, as it ensures that it gets assigned to me.
 * Thank you,
    Dimitris
 *  Plugin Support [Imran – WPMU DEV Support](https://wordpress.org/support/users/wpmudev-support9/)
 * (@wpmudev-support9)
 * [5 years, 12 months ago](https://wordpress.org/support/topic/inline-css-and-background-images/#post-12979011)
 * Hello there [@allennichelabs](https://wordpress.org/support/users/allennichelabs/)
 * I hope you are doing well!
 * We haven’t heard back from you for a while now so we’ve marked this ticket as
   resolved. If you do have any followup questions or require further assistance
   feel free to reopen it and let us know here.
 * Kind regards,
    Nastia

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Inline CSS and Background Images’ is closed to new replies.

 * ![](https://ps.w.org/hummingbird-performance/assets/icon-256x256.gif?rev=2633221)
 * [Hummingbird Performance - Cache & Page Speed Optimization for Core Web Vitals | Critical CSS | Minify CSS | Defer CSS Javascript | CDN](https://wordpress.org/plugins/hummingbird-performance/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/hummingbird-performance/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/hummingbird-performance/)
 * [Active Topics](https://wordpress.org/support/plugin/hummingbird-performance/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/hummingbird-performance/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/hummingbird-performance/reviews/)

 * 4 replies
 * 4 participants
 * Last reply from: [Imran – WPMU DEV Support](https://wordpress.org/support/users/wpmudev-support9/)
 * Last activity: [5 years, 12 months ago](https://wordpress.org/support/topic/inline-css-and-background-images/#post-12979011)
 * Status: resolved