Using a protocol-independent absolute path

Snippet

If the browser is viewing an page in SSL through HTTPS, then it’ll request that asset with the https protocol, otherwise it’ll request it with HTTP.

<img src="//domain.com/img/logo.png"/>
 
Use the // ignoring the protocol.

Add new comment

Plain text

  • No HTML tags allowed.
  • Lines and paragraphs break automatically.