Title: Css Background Images Wrong Path
Last modified: December 14, 2021

---

# Css Background Images Wrong Path

 *  Resolved [bluantinoo](https://wordpress.org/support/users/bluantinoo/)
 * (@bluantinoo)
 * [4 years, 5 months ago](https://wordpress.org/support/topic/css-background-images-wrong-path/)
 * Hello,
    when I enable caching, images called from the theme’s CSS have a wrong
   path relative to the cache folder instead of the theme folder.
 * Quick example.
 * css file is `wp-content/mytheme/css/mytheme.css`
 * images are in `wp-content/mytheme/css/images/`
 * in css file I set the rule `background-image: url("images/image.svg")`
 * in the cached version of css the image path is instead `wp-content/cache/swift-
   performance/...`
 * but naturally the image is not there.. so nothing is shown
 * is there a fix or I’m forced to use absolute path for css background images?
    -  This topic was modified 4 years, 5 months ago by [bluantinoo](https://wordpress.org/support/users/bluantinoo/).

Viewing 1 replies (of 1 total)

 *  Thread Starter [bluantinoo](https://wordpress.org/support/users/bluantinoo/)
 * (@bluantinoo)
 * [4 years, 5 months ago](https://wordpress.org/support/topic/css-background-images-wrong-path/#post-15165250)
 * Solution found: just **not use quotes for images url**.
 * So,
    if I use `url("images/image.svg")` images path are relative to cache folder
   if I use `url(images/image.svg)`images URLs in cached CSS is correctly generated
   as absolute URL and image is found.
 * That’s weird. But solved
    -  This reply was modified 4 years, 5 months ago by [bluantinoo](https://wordpress.org/support/users/bluantinoo/).

Viewing 1 replies (of 1 total)

The topic ‘Css Background Images Wrong Path’ is closed to new replies.

 * ![](https://ps.w.org/swift-performance-lite/assets/icon-256x256.jpg?rev=2388229)
 * [Swift Performance Lite](https://wordpress.org/plugins/swift-performance-lite/)
 * [Support Threads](https://wordpress.org/support/plugin/swift-performance-lite/)
 * [Active Topics](https://wordpress.org/support/plugin/swift-performance-lite/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/swift-performance-lite/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/swift-performance-lite/reviews/)

 * 1 reply
 * 1 participant
 * Last reply from: [bluantinoo](https://wordpress.org/support/users/bluantinoo/)
 * Last activity: [4 years, 5 months ago](https://wordpress.org/support/topic/css-background-images-wrong-path/#post-15165250)
 * Status: resolved