Take the 2-minute tour ×

I have a web page containing am entry form. HTTPS is enabled via an Apache redirect for all requests matching that page. Unfortunately, because the CSS pulls in external images using 'background-image: url(/images/...)', the browser will generate a warning message that the page contains mixed content.

What's the best way to resolve this issue?

share|improve this question

3 Answers 3

Here is a very popular solution:



<img src="//domain.com/img/logo.png">


div{background: url(//path/to/image.png);}

See more information here http://paulirish.com/2010/the-protocol-relative-url/

share|improve this answer
@Kifin, Did this answer your question, Let me know if not, Thanks –  adardesign Apr 18 '12 at 18:57

You should also enable HTTPS for your static resources, and then make sure that the <link> refers explicitly to the HTTPS url for the CSS resource (whose relative urls will then be interpreted relative to the HTTPS base of the CSS file).

share|improve this answer

You should use full URL for your image:




This solved my problem some time ago.

share|improve this answer

Your Answer


