1

Possible Duplicates:
Can I change all my links to just //?
Network-Path Reference URI / Scheme relative URLs

Iv seen some websites using something like this:

background:url(//cdn.domain.com/images/bg-normal.png)

Notice the "//", which the browser automatically translates to "https://" if the page if using HTTPS, and translates to "http://" if the page if using HTTP.

Is it only the modern browsers who supports this notation?

Is it recommended to use this notation, or should I hardcode https:// or http:// in the CSS file depending on HTTPS or HTTP.

Community
  • 1
  • 1
Jonathan Rioux
  • 1,067
  • 2
  • 14
  • 30

1 Answers1

2

According to Paul Irish's blog post, it works in IE as well.

visualidiot
  • 532
  • 3
  • 5