Page 1 of 1

Images in CSS

Posted: Wed Jun 21, 2017 11:33 am
by paulzz
How do I link images that are defined in my CSS?
I'm using Wordpress but lots of my images have to be added this way.

Re: Images in CSS

Posted: Thu Jun 22, 2017 10:48 am
by aaronp
Hi,

While you may define your images whichever way you'd like in your CSS, the ImageEngine plugin does not touch the CSS so you cannot link images defined in your CSS. When the ImageEngine plugin is installed, images published as part of the content are optimized by ImageEngine; and then if you want the referred images in your theme to be optimized (logos, designs, elements, etc.), you will have to change the theme to use the plugin.

What you could do to have an image in your CSS be optimized by ImageEngine, would be to append your ImageEngine token to your image URL like such:

Code: Select all

#divID {
background-image: url("http://TOKEN.lite.imgeng.in/http://www.example.com/image.jpg");
....
}
Hope this helps. Feel free to let me know if you have any other questions or concerns.

Thanks,

Aaron

Re: Images in CSS

Posted: Fri Jun 23, 2017 7:00 am
by paulzz
Thanks Aaron!

Do you know if I can use https instead? Using http would break the TLS certificate.

Re: Images in CSS

Posted: Fri Jun 23, 2017 9:09 am
by aaronp
Hi,

You can use https instead of http.

Aaron

Re: Images in CSS

Posted: Fri Jun 23, 2017 12:04 pm
by paulzz
Great, thanks.